#include<iostream> #include<fstream> #include<iomanip> #include <cstdlib> using namespace std; class student { int rollno; char name[50]; int p_marks, c_marks, m_marks, e_marks, cs_marks; double per; char grade; void calculate(); public: void getdata(); void showdata() const; void show_tabular() const; int retrollno() const; }; void student::calculate() { per=(p_marks+c_marks+m_marks+e_marks+cs_marks)/5.0; if(per>=60) grade='A'; else if(per>=50) grade='B'; else if(per>=33) grade='C'; else grade='F'; }