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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started