Course Grade Calculation (READ ASAP)

Hi I have to Write a program that uses structure to store the following data:
Member Name Description
studentID Student ID
name Student Name
programmingExercise pointer to an array of programming exercise scores
quizzes pointer to an array of quizes
midTerm Mid-Term exam score
final Final exam score
attendanceParticipation Attendance and class participation score
finalScore Course final score (see the formula below)
finalGrade Course final grade (Letter Grade i.e. A, B, C, D, F)


The program should keep a list of scores for a group of students. It should ask the user how many students they want to keep track of and how many scores there are. It should then dynamically allocate an array of structures. Each structure's programmingExercises and quizzes should point to a dynamically allocated array that will hold the scores for the programmingExercises, and quizzes respectively.After the arrays have been dynamically allocated, the program should prompt the user to enter data for each student (student ID number, student name, and all scores). The course grade should be calculated as follows:

1.programmingExercises: (Sum of all programming exercise scores/num of programming exercises) * 0.70
2.quizzes = Sum of all quizzes * 0.10
3.MidTerm = MidTerm Exam Score * 0.05
4.final = Final Exam Score * 0.10
5.attendanceParticipation *0.05
6.finalScore = 1 + 2 + 3 + 4 + 5
7.finalGrade = finalScore expressed as the letter grade according to the following grading scale:

Final Score Final Grade
90 - 100 A
80 - 89 B
70 - 79 C
60 - 69 D
< 60 F
The finalScore and the finalGrade should be stored in the corresponding structure members for each student structure. Your program should display a table listing each student's ID, student name, final score, and final grade.

This is what Ive create so far..


#include <iostream>
using namespace std;

int main()
{

char name [100];
char quit;
quit ='\0';
while (quit !='q')
{

system("Course Grade Calculation");
system("color 80");
int a, b, c, d, f, x, z; //loads integers into memory


cout <<"This is a Final Grade Calculator Program. Just input your 5 most highest grade when asked" << endl;
cout <<"Please enter your name?"<< endl;
cin.getline (name,100);
cout <<"Hello," << name << "."<< endl;
cout <<"Input your first grade:"<< endl;
cin>> a; //Receives grade and loads it into memory

cout <<"Input your second grade:"<< endl;
cin>> b;

cout<<"Input your fourth grade:"<< endl;
cin>> d;

cout<<"Finally, enter your last grade:"<< endl;
cin>> f;

z = a+b+c+d+f; //(starting division equation)
x = z; //makes the x integer equal to z

if (x/5<=65)
{
cout <<"Are you even trying to pass your class!?" << endl;
}
else if (x/5==75)
{
cout<<"Try to pick up the pace a bit more."<< endl;
}
else if (x/5==80)
{
cout<<"You are doing a great job with keeping your grades up."<< endl;
}
else if (x/5==90)
{

cout<<"You're doing an awesome job!"<< endl;
}
else if (x/5>=95)
{
cout<<"Teachers pet; I see!"<< endl;
}
cout<<"Your average is " << x/5 << ".\a"<< endl; //(all grades/5)
cout<<""<< endl;
cout<<"Q - Quit"<< endl;
cout<<"R - Repeat"<< endl;
cout<<"Please type in the letter for your choice then press enter." << endl;
cin>> quit;
cout << "Goodbye," << name << "." << endl;


system("PAUSE");
system("cls");

}
return 0;

}



Im pretty sure I have everything above. Though if you open Dev & run it; it doesnt ask for you to input your second grade nor third and fourth? And I dont know why.

Last But not least I have to Read in the number of scores, number of students, studentID, student name, and all scores from a file. I need to provide input data file. (25%) Drop the lowest programming exercise score. (25%)
^--anyone know how to do that? Thanks :)
Last edited on
Well, it seems sort of done. Except that it doesn't work..
problem 1: in declaration of 'dimensions' struct, why 9 and 6 ? Do you assume them to be default values?
problem 2: in declaration of 'results' struct. You cannot assign to members like this. If you want default values, write a constructor.
Topic archived. No new replies allowed.