ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 3 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 02 May 2017 My Price 9.00

The Triangle Classification Algorithm

Please see the attachment for algorithm. We need to use Python for this short programming assignment. 

For this assignment, you need to create a function that implements the Triangle Classification Algorithm. The algorithm has a lot of steps in it, but each step is simple. We have covered enough material to implement this. 

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

Everything else on the chart should be easy to understand, but ask questions if needed.

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

 

 

For this assignment, you need to create a function that implements
the Triangle Classification Algorithm. The algorithm has a lot of
steps in it, but each step is simple. We have covered enough
material to implement this.
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, &quot;Read i, j, k&quot;. These variables should be passed in as
parameters to your function. The second oval is equivalent to
if i &lt;= 0 or j &lt;= 0 or k &lt;= 0
Everything else on the chart should be easy to understand, but ask
questions if needed.
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. Triangle Classification Algorithm

Attachments:

Answers

(11)
Status NEW Posted 02 May 2017 08:05 AM My Price 9.00

-----------

Not Rated(0)