The question is the question asked user to prompt how many student's CGPA wished to be calculated from 0 to 99. Then it ask user to enter how many years he is doing his course to calculate his overall CGPA for the course for the user entered.
This is the header file
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#include <iostream>
#include <string>
usingnamespace std;
class Student //class
{
public:
Student(string name);
void GetPointers();
void display();
private:
double points[3][4]; // using 2D array
int CreditHour[3][4]; // using 2D array
string name;
double CalculateGPA();
double CalculateCGPA();
};
One problem appears to be line 42. Don't you want to use the += operator? As you have it, totalPoints will be reset each time through the loop.
Lines 48-49 will never be executed. Most compilers should flag this with at least a warning.
Line 48: This is a duplicate declaration. calcualteCGPA has already been declared at line 36. This also should have been flagged by your compiler as an error.
The question is "The program should ask user to enter total year of semesters to be calculated as CGPA. Now i able to get for one year only. Lets say the user total year of semesters is 12, so it should calculate the total CGPA for the 12 semesters. So far i able to get 1 year which is equivalent to 3 semesters only.