So I have a programming lab that we did in class for a few months but I am having major difficulity on it. These are the directions:
Specifications for Calculate grades using loops
- Create pseudo code for your program first, to be handed in.
- Make the program user friendly.
- Use a constant at the top of the program for:
a. Test points percent = 65%
b. Lab. points percent = 25%
c. Note points percent = 25% - Make sure you use a loop for each of the three average calculations below.
a. Average Test scores, (add all the test scores and divide by the number of test). Average Lab scores, (add all the lab scores and divide by the number of labs).
b. Average Notes scores, (add all the notes scores and divide by the number of notes). - Take the totals from above and multiply them by the respective points.
a. Divide the test average by the test point’s percentage.
b. Divide the lab average by the lab point’s percentage.
c. Divide the notes average by the notes point’s percentage - Add the points together to find the number grade.
- Print out the letter grade next to the numeric grade.
a. 96.45 and up = A+
b. 92.45 – 96.44 = A
c. 88.45 – 92.44 = B+
d. 84.45 – 88,44 = B
e. 80.45 – 84.44 = C+
f. 76.45 – 80.44 = C
g. 73.45 – 76.44 = D+
h. 69.45 –73.44 = D
i. Less than 69.45 = F - End.
And this is the code that I have but I can't see what I did wrong:
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
// Include different students and clear up spaces with breaks.
int main()
{
int test1, test2, test3;
int lab1, lab2, lab3;
int notes1, notes2, notes3;
int name;
float TestAverage = .65;
float LabAverage = .25;
float NotesAverage = .10;
cout << "What is your name?";
cin >> name;
cout << "What is your first test grade? ";
cin >> test1;
cout << "What is your second test grade? ";
cin >> test2;
cout << "What is your third test grade? ";
cin >> test3;
cout << "What is your first lab grade? ";
cin >> lab1;
cout << "What is your second lab grade? ";
cin >> lab2;
cout << "What is your third lab grade? ";
cin >> lab3;
cout << "What is your first notes grade? ";
cin >> notes1;
cout << "What is your second notes grade? ";
cin >> notes2;
cout << "What is your third notes grade? ";
cin >> notes3;
float TestAverage = (test1 + test2 + test3)/3;
float LabAverage = (lab1 + lab2 + lab3)/3;
float NotesAverage = (notes1 + notes2 + notes3)/3;
cout << "Your grade average is... ";
cin << TestAverage + LabAverage + NotesAverage;
if (Grade > 96.45 )
{cout << "Grade = " << Grade << " A+ "; } else
if (Grade > 92.45 && Grade < 96.45)
{cout << "Grade = " << Grade << " A "; } else
if (Grade > 88.45 && Grade < 92.45)
{cout << "Grade = " << Grade << " B+ "; } else
if (Grade > 84.45 && Grade < 88.45)
{cout << "Grade = " << Grade << " B "; } else
if (Grade > 80.45 && Grade < 84.45)
{cout << "Grade = " << Grade << " C+ "; } else
if (Grade > 76.45 && Grade < 80.45)
{cout << "Grade = " << Grade << " C "; } else
if (Grade > 73.45 && Grade < 76.45)
{cout << "Grade = " << Grade << " D+ "; } else
if (Grade > 69.45 && Grade < 73.45)
{cout << "Grade = " << Grade << " D "; }
else
{cout << " Final grade = " << Grade << " F "; }
cout << " " << endl; cout << " " << endl;
system("pause");
return 0;
}