Hi,
I have some questions about a program in which we calculate a GPA(Grade Point Average).
Eg.
formula:
GPA = Grade Point + Credit Hours;
My program is :
Code:
class student
{
public:
student(int Grade_Point,int Credit_Hour); //initializing the data members of the class using constructor/
~student(); // destructor of the class/
void GetData();
void CalculateGPA();
void WriteData();
private:
int Grade_Point;
int Credit_Hour ;
GPA = Grade Point + Credit Hours; // formula used for calculating GPA(Grade Point Average)/
};
int main()
{
cout<<"Student GPA";
int Grade_Point;
int Credit_Hour;
int GPA;
system("pause");
}
-----------------------------------------------
I wanted to know that can I declare arrays for GP and Credit Hours,so that they could be used in the formula for GPA calculation?
Also pls let me know if I have correctly initalized the data members of the class using the constructor.
My other question is that do I have to use "int" before main()?
I hope I am clear