cp /home/fac/melissa/public_html/cs221/demos/array_example.cpp .Note the period at the end of the cp command, this is critical to get cp to copy the file to your current directory.
Compile and run the program using the following commands:
g++ -o demo array_example.cpp ./demoYou should see how the variables i and min get overwritten by using invalid subscripts for the array. This is why you, as the programmer, must keep track of the size of the array when accessing elements using the subscript operator.
Program Requirements: Create an array that can hold 5 doubles. Use a for() loop to prompt the user to enter in 5 doubles. Calculate the product of all 5 doubles using either a second for() loop or by calculating it while reading in the doubles. Print out each of the doubles in the array using a for() loop, then print out the product that you have calculated.
The output should resemble the following (the user input is in blue font face):
Enter double 1: 1 Enter double 2: 1.5 Enter double 3: 2 Enter double 4: 3.2 Enter double 5: 2.5 The product of 1 1.5 2 3.2 2.5 is 24.Name your code lab7.cpp. Email your completed code to me.