homework help 4196

Write a function that implements the Triangle Classification Algorithm.

The Triangle Classification Algorithm accepts three integer lengths and it returns a 1, 2, 3, or 4. The three lengths represent possible lengths to the sides of a triangle. Returning a 1 means that the lengths would form a scalene triangle. Returning a 2 means that the sides would form an isosceles triangle. Returning a 3 means that the sides would form an equilateral triangle. Returning a 4 means that the sides cannot form a triangle. For example, sides 1, 1, and 10 cannot form a triangle.

Below you will find a control flow graph of the algorithm. The brackets in the graph [ and ] are just there as a means of referencing each condition. Also, the || symbol is or. The top oval says, “Read i, j, k”. These variables should be passed in as parameters to your function. The second oval is equivalent to

if i <= 0 or j <= 0 or k <= 0

Write a function for the implementation of the Triangle Classification Algorithm. Also, Write a program that uses the function. This program should ask the user to enter the three lengths, and it returns the result of calling the function.


15% off for this assignment.

Our Prices Start at $11.99. As Our First Client, Use Coupon Code GET15 to claim 15% Discount This Month!!

Why US?

100% Confidentiality

Information about customers is confidential and never disclosed to third parties.

Timely Delivery

No missed deadlines – 97% of assignments are completed in time.

Original Writing

We complete all papers from scratch. You can get a plagiarism report.

Money Back

If you are convinced that our writer has not followed your requirements, feel free to ask for a refund.

× How can I help you?