Question: This program will compute the area of a triangle given the 3 sides (all floating-point numbers). Specifically, you should: Write a function that will ask
This program will compute the area of a triangle given the 3 sides (all floating-point numbers). Specifically, you should:
Write a function that will ask the user to enter 3 sides of a triangle and return those as reference parameters. The function should use loops to validate so that each side is greater than zero.
Write another function that will accept 3 sides of a triangle as value parameters and compute and return the triangle's area. Use the formula shown below to perform the computation.
area = sqrt( s(s-a)(s-b)(s-c) ), where s = (a + b + c) / 2
Write a main program that will allow the user to enter as many triangles as he wishes. The user should be prompted after each triangle to see if he would like to continue.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
