User Defined Class Program, assistance needed

I have to write a program that meets the following criteria:

[p]
Build a class called "grades_record" for storing the grades of each student in this course. This class will have the following integer (int) attributes (suggested variable names in parentheses):

an ID number for the student
grade for Programming Assignment 1 (prog1)
grade for Programming Assignment 2 (prog2)
grade for Programming Assignment 3 (prog3)
grade for Programming Assignment 4 (prog4)
grade for Programming Assignment 5 (prog5)
grade for Programming Assignment 6 (prog6)
grade for the midterm exam (MT)
grade for the final exam (final)
grade for the extrac credit assignment (EC)

Create the following methods:

constructors for a default grade record with ID and all grades set to 0 and for a grade record where all initial values are specified
accessors that return the ID and each grade
mutators that set/edit the ID and each grade
a function that calculates the final, overall score based on the formula:
final_score = prog1 + prog2 + prog3 + prog4 + 10*prog5/15 + prog6 + 20*MT/100 + 20*final/100 + EC

Once the class is set up, create a main function that calculates and outputs the final, overall score for the following students, along with their IDs:

Jack: ID(10012), prog1(10), prog2(10), prog3(8), prog4(8), prog5(9), prog6(10), MT(70), final(90), EC(0)
Jill: ID (11247), prog1(10), prog2(10), prog3(9), prog4(10), prog5(8), prog6(8), MT(70), final(85), EC(5)
Max: ID(10966), prog1(10), prog2(0), prog3(0), prog4(5), prog5(0), prog6(8), MT(60), final(50), EC(0)
[/p]

I have the class file written, my issue is, how do I code the Main file? I'm not really certain on how one goes about calling the function and setting values etc. Help would be appreciated!

Below is what I have for my class .h and .cpp file-

.h file:
[p]
class grades_record
{
private:
int IDJack,IDJill,IDMax, assignment1, assignment2, assignment3, assignment4,assignment5, assignment6,MT,FINAL,EC;


public:
double final_grade;
int getIDJack(), getIDJill(),getIDMax();
void setIDJack(double newIDJack), setIDJill(double newIDJill),setIDMax(double newIDMax);
double getprog1(),getprog2(),getprog3(),getprog4(),getprog5(),getprog6(),getMT(),getfinal(),getEC();
void setprog1(double newprog1), setprog2(double newprog2),setprog3(double newprog3),setprog4(double newprog4),setprog5(double newprog5),setprog6(double newprog6),setMT(double newMT),setfinal(double newfinal),setEC(double newEC);
double grades_record::finalgrade();

};

[/p]

for my .cpp file:

[p]
# include "grades_record.h"
# include <cmath>

using namespace std;

int grades_record::getIDJack()
{
return IDJack;
}

int grades_record::getIDJill()
{
return IDJill;
}

int grades_record::getIDMax()
{
return IDMax;
}

double grades_record::getprog1()
{
return assignment1;
}

double grades_record::getprog2()
{
return assignment2;
}

double grades_record::getprog3()
{
return assignment3;
}

double grades_record::getprog4()
{
return assignment4;

}

double grades_record::getprog5()
{
return assignment5;
}

double grades_record::getprog6()
{
return assignment6;
}

double grades_record::getMT()
{
return MT;

}
double grades_record::getfinal()
{
return FINAL;
}

double grades_record::getEC()
{
return EC;

}

void grades_record::setIDJack(double newIDJack)
{

IDJack=newIDJack;
}

void grades_record::setIDJill(double newIDJill)

{
IDJill=newIDJill;
}

void grades_record::setIDMax(double newIDMax)
{
IDMax=newIDMax;
}



void grades_record::setprog1(double newprog1)
{
assignment1=newprog1;
}
void grades_record::setprog2(double newprog2)
{
assignment2=newprog2;
}
void grades_record::setprog3(double newprog3)
{
assignment3=newprog3;
}
void grades_record::setprog4(double newprog4)
{
assignment4=newprog4;
}
void grades_record::setprog5(double newprog5)
{
assignment5=newprog5;
}
void grades_record::setprog6(double newprog6)
{
assignment6=newprog6;
}
void grades_record::setMT(double newMT)
{
MT=newMT;
}
void grades_record::setEC(double newEC)
{
EC=newEC;
}
void grades_record::setfinal(double newfinal)
{
FINAL=newfinal;
}
double grades_record::finalgrade()
{
double x;
x=assignment1+assignment2+assignment3+assignment4+(10*assignment5/15)+assignment6+(20*MT/100)+(20*FINAL/100)+ EC;
return x;
}
[/p]
Topic archived. No new replies allowed.