Lab 8 - Passing Arrays to Functions

The purpose of this array is to learn how to pass arrays to functions, in particular, an input function, a calculation function and an output function.

Program Requirements: You will be creating a program to read in an array of doubles from the keyboard, calculate the sum, and print the array and its sum. In main(), declare a double array that can hold up to 50 doubles and an integer to store the current size (initialize this to 0). Then call the getArray() and printArray() functions (integer versions were discussed in class on Wednesday).

The required functions for this assignment are:

The output should resemble the following (the user input is in blue font face):
How many doubles do you wish to add? -5

That is an invalid size. You must enter a value between 1 and 50.
How many doubles do you wish to add? 5

Enter double 1: 1
Enter double 2: 1.5
Enter double 3: 2
Enter double 4: 3.2
Enter double 5: 2.5

The array contains: 
1.00   1.50   2.00   3.20   2.50

The sum is 10.2
Name your code lab8.cpp and email your completed code to me.