//GradesSum.h
#ifndef GRADESSUM_H
#define GRADESSUM_H
#include <iostream>
#include "Grades.h"
usingnamespace std ;
class GradesSum : public Grades
{
public :
float sum;
void getGradesSum()
{
sum = 0;
sum +=total;
cout << "The Sum Of Grades is :" << sum << endl;
}
};
#endif
I don't really understand your problem. Would you please describe it a little more detailed, please?
But nevertheless here are some tipps:
Grades::total, GradesSum::sum: These attributes may and one of them will be used uninitialized, so their contents may be undefined. Use a constructor to do initialization (see Tutorial on Cplusplus.com for details).
Header files are usually meant for specification, mainly classes, only. Better put your implementation into separate source files. Use f.e. Grades.cpp and GradesSum.cpp.