

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


#include
cout<<"\n Marks of Subject 1 : "<<sub1; cout<<"\n Marks of Subject 2 : "<<sub2; cout<<"\n Marks of Subject 3 : "<<sub3; cout<<"\n Marks of Subject 4 : "<<sub4; cout<<"\n Marks of Subject 5 : "<<sub5; } }; class StudentResult : public StudentExam { public: void calculate () { total=sub1+sub2+sub3+sub4+sub5; average = (total)/5.0; cout<<"\n\nTotal marks: "<<total<<endl; cout<<"\nAverage: "<<average<<endl<<endl; if(average>90 && average<=100) { cout<<"Grade:S"<<endl; } else if(average>80 && average<=90) { cout<<"Grade:A"<<endl; } else if(average>70 && average<=80) { cout<<"Grade:B"<<endl; } else if(average>60 && average<=70) { cout<<"Grade:C"<<endl; } else if(average<=60) { cout<<"Grade:F"<<endl; } } }; int main() { StudentResult str; int cnt, i; cout<<"\n Enter Number of Students: "; cin>>cnt; for(i=0; i<cnt; i++) {