Write a program that will ask the user for 10 numbers, store them in an array, print the array, and print the average of the numbers entered.
You should:
All steps should be pseudo-coded before actually going to the computer, and you will be required to submit the pseudo-code of your project (in a doc or txt file) as part of your submission.
Write a function that prompts the user to enter 10 numbers, accepting double format, and return an array containing those numbers.
Write a function to output the elements of the array in a nice format.
Write a function which accepts the array as input and returns the average of the numbers in the array.
Write a main program to effectively tie these functions together and solve the problem.
Define at least two sets of test data and the expected results when the program will run using these sets as input.
Here is what I have come up with so far....
#include <iostream>
using namespace std;
int main()
{
int sum = 0;
int average = 0;
int array[10] = {1,2,3,4,5,6,7,8,9,10};
for (int i = 0; i < 10; ++i)
sum+=array[i];
average = sum/10;
cout<<"Average:"<<average;
}