Question: USING C++ CODING Objectives: 1. Be able to use the call-by-value mechanism 2. Be able to use the call-by-reference mechanism Write a program called all

USING C++ CODING

USING C++ CODING Objectives: 1. Be able to use the call-by-value mechanism

2. Be able to use the call-by-reference mechanism Write a program called

Objectives: 1. Be able to use the call-by-value mechanism 2. Be able to use the call-by-reference mechanism Write a program called "all area semi.cpp" that computes the area of an arbitrary triangle. Use the following formula area = /s(s-a)(s-b)(s-c) where a, b and c are the lengths of the sides, and s is the semiperimeter. s=(a + b + c) / 2 Include a void function call "Compute" that computes the area and perimeter of a triangle based on the length of the sides. The function should use five parameters three call by value parameters (a, b, c) that provide the lengths of the edges and two call by reference parameters (area, semiperimeter) that stores the computed area and perimeter. Make your function robust. The function "compute should be called from your main program. Your must print the computed area and semiperimeter rounded to the nearest hundredths. In main you should declared the necessary variables, and include a while loop asking the user if he/she would like to continue computing area and semiperimeters Note that not all combinations of a, b, and c produce a triangle. Remember, the sum of any two sides of a triangle must be greater than the third side. You must make sure that the lengths of the sides of the triangle entered by the user are valid; if not valid lengths, you should let the user know by printing a message stating that the lengths are invalid, and then prompt the user if he/she would like to continue computing area and semiperimeters. Your function should produce correct results for legal data and reasonable results for illegal combinations

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!