Need immediate help writing program due tomorrow

You are to write a complete C++ program that does the following.

It will ask the user how many students there are to be processed.

It will then, using a for loop, request the 5 grades for that student.

It will then calculate the average to 2 decimal place based as follows:

Grades 1-3 count 20% each

Grade 4 counts 10%

Grade 5 counts 30%

The output for each student will appear as follows:

Student # Grade 1 Grade 2 Grade 3 Grade 4 Grade 5 Avg Letter Grade

Student# IS THE THE POSITION IN THE FOR LOOP

USE THE FOLLOWING DATA

Grade 1 Grade 2 Grade 3 Grade 4 Grade5

85 88 90 80 78

77 84 77 75 89

94 89 88 83 93

65 77 73 86 80

55 65 71 70 55

Add at least 3 more students to the list.

Make sure all grades are represented.

Print out both your program and the generated output.

Letter grades as follows

90-100 A

80 up B

70 up C

60 up D

Under 60 F


I need help immediately. Please I dont know where to start. If possible please write out the whole program I'd appreciate it.
Last edited on
I need help immediately. Please I dont know where to start. If possible please write out the whole program I'd appreciate it.


Sounds like you've waited to till the last minute to do your assignment. I don't think I have to tell you that this is a bad practice. Why don't you crack open a C++ textbook, or use google, or something, and try and solve the problem yourself? The purpose of this board isn't to get your programming homework done for you, but instead to come and ask questions so that others can help you learn.
Yes I know but I am trying to study for a test tomorrow and was hoping if someone can take some work off my shoulders. I absolutely agree with what you are saying. I am taking five classes and its really hard to keep up. This is my first c++ class and it seems very difficult for me.
Last edited on
okay i have tried writing out the program out myself and this is what i have came up with. Let me know if there are any errors because I dont have c++ and it wont run on my laptop anyways.

#include<iostream>
#include<iomanip>
using namespace std;
int main ( )

{
double grade1, grade2, grade3, grade4, grade5;
double avg;
int students;
char lettergrade;
cout<<"How many students there are to be processed?\n";
cin>>students;
for(int i=1; i<=students; i++) {

cout<<"grade1 = \n";
cin>>grade1;
cout<<"grade2= \n";
cin>>grade2;
cout<<"grade3= \n";
cin>>grade3;
cout<<"grade4= \n";
cin>>grade4;
cout<<"grade5= \n";
cin>>grade5;
cout<<"Grade1\tGrade2\tGrade3\tGrade4\tGrade5\t"<<endl;
cout<<grade1<<"\t"<<grade2<<"\t"<<grade3<<"\t"<<grade4<<"\t"<<grade5<<endl;

grade1=grade1 *.20;
grade2 = grade2*.20;
grade3 = grade3*.20;
grade4 = grade4 *.10;
grade5 = grade5*.30;
avg= (grade1+grade2+grade3+grade4+grade5);
if (avg >= 90.0 && avg<= 100.0)
lettergrade= 'A' ;
else if(avg >= 80.0 && avg<= 89.9)
lettergrade='B';
else if (avg>= 70.0 && avg<= 79.9)
lettergrade='C';
else if (avg>= 60.0 && avg<= 69.9)
lettergrade='D';
cout<<setprecision(2)<< fixed;
cout<<avg<<"\t"<<lettergrade<<endl;

}

system ("pause");
return 0;

}
Topic archived. No new replies allowed.