I have to write a program that should read test scores students received on the first quiz into an array. Assume that up to 30 students could be entered. Input will stop when the sentinel value -1 is entered.

Write functions to:

1. Read the original scores into arrays

2. Compute the distribution of scores accordeing to the following scheme, i.e. count number of As, Bs, etc.

A:90-100

B:80-89 and so on

3. Find how many students have the same score.

4. Display number of students, the distribution of scores, and number of students with the same score.

This is what I have so far; everything works except totaling the students. I am trying to do this step by step. I have the read test scores, but now I am trying to total the number of students, then compute the distribution.

```
#include <iostream>
#include <iomanip>
#include <string>
#include <cmath>
using namespace std;
void readinfo(int);
int totalstudents (int);
void displayinfo;
int main()
{
const int VALS_LEN = 30;
int totalstudents[VALS_LEN];
cout << "Welcome to the student test manager!" << endl;
readinfo(VALS_LEN);
cout << endl;
cout << "Report " << endl;
cout << "______ " << endl;
cout << endl;
cout << "Number of students: " << totalstudents << endl;
system ("pause");
return 0;
}
void readinfo(int testscores)
{
for( int studentScores = 0; studentScores < testscores; studentScores ++)
{
while(testscores != -1)
{
cout << "Please enter student test scores (or -1 to quit): ";
cin >> testscores;
}
}
}
int totalstudents (int students)
{
int testscores;
int total = 0;
for (int students = 0; students < 30; students ++)
{
total = testscores ++;
return total;
}
}
void displayinfo
```

*Edited 4 Years Ago by WaltP*: Added CODE Tags -- please use them