Help with this problem !!

Hey guys I'm taking a computer science 1 course and this problem is killing me.
I just have no idea on how to start this.
(a) Write a C++ program that reads in 20 SAT scores and prints all the scores,
indicates the highest score, the second highest score and number of scores
in each of the following categories:
1) scores>= 700
2) 600<=scores<700
3) 500<= scores<600
4) 400<=scores<500
5) 300<=scores<400
6) 200<=scores<300
Make up your own data.

I was thinking of using a for loop.
for(counter=1;counter<=20;counter++)
To read in the 20 SAT scores but I'm just stuck, please help!
Bubble sort may be the best way to go about this.
I have no idea what Bubble sort is
Can you give me an idea of what your teacher is expecting of you. I can give you a better idea of how to go about this if I know what level of skill you are coding on. And example of some work would do just fine.
//This program averages test scores. Asks the user for the # of students and # of tests scores per student.

#include<iostrea>
#include<iomanip>
using namespace std;
int main()
{
int numStudents, numTests;
double total, average;

cout<<fixed<<showpoint<<setprecision(1);

cout<<"How many students do you have?"<<endl;
cin>>numStudents;
cout<<"How many test scores does each student have?"<<endl;
cin>>numTests;

for(int student=1;student<=numStudents;student++)
{
total=0;
for(int test=1;test<=numTests;test++)
{
double score;
cout<<"Enter score"<<test<< " for ";
cout<<"student "<<student<<": ";
cin>>score;
total+=score;
}
average=total/numTests;
cout<<"The average score for student "<<student;
cout<<" is "<<average<<".\n\n";
}
return 0;
}
Fix: spelling of <iostream> you missed the M.

can you explain a bit more what your application is supposed to do. Your first post is still confusing me. I can help you figure this out very easy once I understand the question more.


The program is suppose to ask the user to input 20 SAT scores and then prints all the scores and indicate which score is the highest score and the second highest score in each category. Lets say they put 633,244,622,600,440 it should show like

1) scores>= 700 None
2) 600<=scores<700 Highest score = 633, Second Highest = 622 600
3) 500<= scores<600 None
4) 400<=scores<500 440
5) 300<=scores<400 None
6) 200<=scores<300 None

Each of them are put into those score categories


Also count how many scores are in each category, like

int count700,count600; //count600 and 700 being the categories

if(number>=700)
count700++;
if(number<700&&number>=600)
count600++;

etc.
Last edited on
Topic archived. No new replies allowed.