Question: Design, code, and verify a program that translates the Pythagorean formula into an expression to find the hypotenuse given the two sides, a and b.
Design, code, and verify a program that translates the Pythagorean formula into an expression to find the hypotenuse given the two sides, a and b.
Use the cmath library, the sqrt, and pow function to evaluate the expression and solve for c, the hypotenuse.
Suggested Algorithm:
Get the student's name. (Prompt for the input and store it in a variable)
Get the day and time the class meets.
Get side1 and side2 of a right triangle.
Calculate the value of the hypotenuse using the Pythagorean equation.
use the sqrt and pow functions
Display the student name, day and time the class meets
Display the values for side1, side2, and the hypotenuse using a column width of 8 and a precision of 2 decimal places.
use iomanip library and the fixed, setprecision, showpoint and setw manipulators
**** C++ Xcode is being used ****
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
