code]Write a program that allows the the student to enter in test scores from a range of 0-200. Determine the number of students having scores in each of the following ranges: 0-24,25-50,50-100,100-200[/code]
Can anyone tell me how to approach this problem. I have got the code started but how would I determine the total number of students in that range. I'm just a beginner and working under arrays section for my class.
void display()
{
cout<<"Program will read the tests scores from the range of 0-200!. It will determine\nthe number of students having scores in each of the following ranges. ";
}
//Function input data of student scores from range of 0-200
void inputtestscores( int list[],int size, int &studentnumber)
{
int index=0;
cout<<"\n\n\tUser Input: ";
for (index=0;index<size;index++)
{
cout<<"\n\t\t";
do
{
cin>>list[index];
if (list[index]<0 || list[index]>200)
cout<<"\nIncorrect";
}
while (list[index]<0 || list[index]>200);
studentnumber++;
}
}
int _tmain(int argc, _TCHAR* argv[])
{
//Display what the program is about
display();
//Allow user to enter in scores. Call function
int intest[10];
int totalstudents;
inputtestscores(intest,10,totalstudents);