Reading Test scores(arrays topic)

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.


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
  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);

	
I was thinking selection sort but not sure how I can in this code :(
hello?
Topic archived. No new replies allowed.