You need to prepare a program to print the given output -


Program: You need to prepare a program to print the given output.

You are to write a program that will input any four float values where the four variables are declared in the 'main' function and perform the following calculations:

0.   read in four float numbers. (you have to pass in the four float variables by reference).

1.   print out the four numbers and the sum of the four numbers.

2.   print out the difference between the first and second number and the difference between the third and fourth number.

3.   print out the first number raised to the second number power (pow function) and the fourth number raised to the third number power.

4.   print out the largest of the four.  (This function, you will only pass in two arguments at one time.)

5.   print out the smallest of the four.  (This function, you will only pass in two arguments at one time.)

6.   print out a running total of the four numbers.  Ex 17.243 21.775  34.488.....  (This function, you will only pass in two arguments at one time.)

Read in the subsequent three numbers:   13.243   5.532    14.713   8.126  to test your code with.

Turn in the source code and the output file.

Restrictions: You have to use functions for each one of the above. You have to pass in two or three floats into each function and pass back the results. The main program is the only place you can do couts, no couts in any function.  Your 'main' can only have couts and function calls.

Note:  For #2 above, you will call the function twice

For  #3, call twice.

For #4 & #5, you will call the function 3 times? 

You need to implement this in C++ language. You need to provide the answer as soon as possible.

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: You need to prepare a program to print the given output -
Reference No:- TGS0957743

Expected delivery within 24 Hours