Question: Problem assignment : Complete the program which calculates values related to a triangle. It will use the following functions: get_side( ) prompts for a length,

Problem assignment: Complete the program which calculates values related to a triangle. It will use the following functions:

get_side( ) prompts for a length, gets the length, returns it check_valid() determines if three lengths make a valid triangle (if the sum of any two sides less than or equal to the third, not a valid triangle ), returns 1 if valid, 0 if invalid calc_perimeter( ) calculates and returns the perimeter, given three sides of a triangle calc_area( ) calculates and returns area of triangle, given three sides (see note below for formula) display_results( ) displays the information about the triangle in a format as follows: 

Sides: nn.nn, nn.nn, nn.nn Perimeter: nn.nnn Area: nn.nnn

The nn.nn(n) indicates a floating point number with the indicated number of digits after the decimal. The number of digits to the left of the decimal point will depend on the value (not necessarily two digits.) Exactly one space between items and a newline at the end of the Area output

You must determine what parameters and return types, if any, each of the functions requires, given the descriptions above.

Fill in the commented areas in main( ) to call your functions, ensuring you use the correct arguments. Do not make any other changes to main( ).

All input and output numbers will be type double.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!