

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
This c++ code defines a class 's' with a method 'a()' that calculates the average and grades based on different inputs. The first method takes a name and roll number as arguments, the second method takes five marks and their number, and the third method takes five marks only. The program then displays the total marks, average marks, and corresponding grades.
Typology: Assignments
1 / 2
This page cannot be seen from the preview
Don't miss anything!


#include
else if(avg>60 && avg<=70) { cout<<'C'; } else if(avg<=60) { cout<<'F'; } getch(); cout<<endl; } }; int main() { s obj; cout << obj.a("Alpana", 18) << endl; cout << obj.a(10, 20, 30, 40, 50, 5) << endl; cout << obj.a(10, 20, 30, 40, 50) << endl; return 0; }