Write a complete C++ program that reads a list of numbers (integers)
from the user, loads them into an array, prints the sum, the largest number,
and the smallest number. You must use three functions: 1)load the array,
2) sum the array, 3)find the smallest and the largest. The main
program is to do ALL of the printing.
- Define three prototypes for the functions: Sum for both integers and doubles, Compare
- define a constant integer MAX to be 20
- In the main program:
- declare an array numbers of size MAX
- declare an array costs of size MAX
- declare an integer sum (initially 0)
- declare a double total (initially 0)
- declare an integer LrgNum (initially 0)
- declare an integer SmlNum (initially 0)
- Set the arrays to values in a loop (as you see fit)
- Next, call the 3 functions
- Print the output from Sum and Compare
- Create stubs for each of the 3 functions
- Compile the code and remove all compilation errors
- Sample code for Part 1
- Write the 3 functions