Lab 1:Review - functions and arrays

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.

  1. Define three prototypes for the functions: Sum for both integers and doubles, Compare
  2. define a constant integer MAX to be 20
  3. 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)
  4. Set the arrays to values in a loop (as you see fit)
  5. Next, call the 3 functions
  6. Print the output from Sum and Compare
  7. Create stubs for each of the 3 functions
  8. Compile the code and remove all compilation errors
  9. Sample code for Part 1
  10. Write the 3 functions