Question: C++ CODE ONLY FOR ANSWER. contains two calculations which you shall do using functions. 2. First write the program without using functions and run it

C++ CODE ONLY FOR ANSWER.

C++ CODE ONLY FOR ANSWER. contains two calculations which you shall do

using functions. 2. First write the program without using functions and runit with the test data. 3. After you have a working program

contains two calculations which you shall do using functions. 2. First write the program without using functions and run it with the test data. 3. After you have a working program write 2 functions: a. Replace the calculation to find the area of a right triangle with a call to a function which does the calculation. b. Replace the calculation to find the volume of a cone with a call to a function which does the calculation. - Recall that the volume of the cone can be generated by rotating the right triangle. The functions should use call by value and return the value for area and the value for volume. 4. The logic of the program is outlined in the comments (pseudocode) given below. Using the pseudocode, supply the appropriate C++ statements to create the program. Input the data from the screen and output to the screen. The test data is: The output is shown at the end of the assignment. 5. Test the program that uses function calls with the same test data. You should get the same results. // Functions Using Pass by Value // your Name \& Date // This program finds the area of a right triangle and / / the volume of the cone generated by rotating the right triangle. // The height and base of the triangle are read from a file. // The height, base, area, and volume are written to a file. *include \#include *include using namespace std; // Function prototypes go here. int main() f // declare the variables / pseudocode 1. Read the base and height. 2. While more data do (Note: use a while loop) 2.a. Find the area of the right triangle. A=21bh 2.b. Find the volume of the cone. V=33.14r2h 2.c. Print the height, base, area, and volume 2.d. Read the next base and height. 3 return 0; I/ Enter the code for the functions here, after main( )

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!