Question: Write a C++ program using user defined functions that will read in the lengths of two side of a right triangle and then calculate the

Write a C++ program using user defined functions that will read in the lengths of two side of a right triangle and then calculate the length of the hypotenuse. The program should do this twice.

The program should the following user defined functions:

Function readA will read in a value for side A from the user and return it to main. (it will not receive any input data from main)

Function readB will read in a value for side B from the user and return it to main. (it will not receive any input data from main)

Function calchyp will receive the values of A and B from main, calculate the hypotenuse and return that value to main.

Print the results to the console screen in a table containing all three columns (a, b, and c).

Test the program with a=3, b=4 and a=6, b=8.

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!