Question: In this exercise, you will modify the hypotenuse program shown earlier in Figure 9-6.Follow the instructions for starting C++ and viewing the ModifyThis13.cpp file, which
In this exercise, you will modify the hypotenuse program shown earlier in Figure 9-6.Follow the instructions for starting C++ and viewing the ModifyThis13.cpp file, which is contained in either the Cpp8\Chap09\ModifyThis13 Project folder or the Cpp8\Chap09 folder. (Depending on your C++ development tool, you may need to open this exercise’s project/solution file first.) Remove both calculation tasks from the main function, and assign both to a program-defined value-returning function named getHypotenuse. Test the program appropriately.


1 //Hypotenuse.cpp - displays the length of a right 2 //triangle's hypotenuse 3 //Created/revised by on 4 5 #include 6 #include 7 #include - 8 using namespace std; required for the pow and sqrt functions 9 10 int main() 11 { double sidea double sideb = 0.0; double sumSqrs = 0.0; double hypotenuse = 0.0; 12 13 14 15 16 17 //get lengths of two sides
Step by Step Solution
3.34 Rating (163 Votes )
There are 3 Steps involved in it
ModifyThis13cpp displays the length of a right triangles hypotenuse Createdrevis... View full answer
Get step-by-step solutions from verified subject matter experts
