will be paying 300fg for the completion of what i started. for anyone who has done C++ before this shouldnt take any more than 10 minutes. im just on a deadline and have many other things to attend to.
directions:
In Lab Exercises #6_1
Arrays
Note: In every exercise, you are expected to test your program to make sure it works before going to the next one. If it doesn’t, you need to fix it; you can always ask for help.
Write a short program that prompts the user and reads in integers into an array called Table. When the user enters a negative number, the input stops. Keep track of how many numbers were read in (at least 5 and no more than 10; what size should you declare the array to have?)
Then add code to do the following:
1. Print how many numbers were read in, and then print out all the numbers that were stored in the array. Test and make sure this works.
2. Find and print the sum of the numbers in the array. Test and make sure it works.
3. Find the average of the numbers in the array. (Make sure the average is a real number, not an integer.)
4. Modify the program so that the array Table is initialized so all values are zero at the time the array is declared.
Have the program checked by the instructor or the lab assistant and submit to Titanium.
what i have so far that you need to use as a template:
/*******************************************************
(my name)
April 18, 2013
CPSC 120
In Lab Exercises #6_1
*******************************************************/
#include <iostream>
#include <string>
using namespace std;
int main()
{
int table [10];
int numberOfScores = 0;
int oneScore = 0;
cout << "Please enter a score; enter -1 to end." << endl;
cin >> oneScore;
while (oneScore >= 0 && numberOfScores < 10)
{
table[numberOfScores] = oneScore;
numberOfScores++;
cout << "Please enter a score; enter -1 to end." << endl;
cin >> oneScore;
}
cout << "The number of scores read in is " << numberOfScores << endl;
return 0;
}