1. Engineering
  2. Computer Science
  3. c please show output...

Question: c please show output...

Question details
C++ please show output




You are to write a program that will input any four float values where the four variables (cin in the values) that are declared in the main function global variables) and perform the following calculations in functions: Have your functions return their values through the return (return value). Do not return values through a pass-by-ref parameter unless otherwise stated. Below are the functions to write with the given restrictions. 0. read in one float number. You will call this function 4 times. 1. print out the four numbers (a one argument function), the sum of four numbers (a two argument function), and the average of the four numbers (a two argument function). (Three functions here) 2. print out the difference between the first number minus the second number and the difference between the third minus the fourth number. (one function called twice.) print out the first number raised to the second number power (pow function) and the fourth 4. print out the largest of the four. (This function, you can only pass in two arguments at one 5. print out the smallest of the four. (This function, you can only pass in two arguments at one 6. print out the average of the three largest numbers using only the existing functions listed above. 7. print out the average of the three smallest numbers using only the existing functions above. 8. print out a running total of the four numbers. Ex 10.243 17.775 33.288 using the Sum 3. number raised to the third number power. one function called twice) time. You will call this function more than once.) time. Same as the previous.) This is not a new function. Same as previous. function. The sum function has only two arguments. Read in the following four numbers: Turn in the source code and the output file. 8.243 15.582 16.513 5.826 to test your code with. Restrictions: You have to use functions for each one of the above. The arguments must be passed by value and no pass by reference. You have to pass in two or less arguments into each function and pass back the results (See above restriction on arguments). The main program is the only place you can do couts, NO couts in any function. Your main can only have couts statements 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? Maybe nest the calls? woe!! For #6 & #7 I have no idea.
Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution