#include #include class STUDENT{ //class declaration, definition int roll_no, marks[5]; char name[20], class_st[8]; float percentage; float calculate(); public: void readmarks(); void displaymarks(); }; void STUDENT::readmarks() //function to accept details { cout<<"Enter roll number, name and class of a student:\n"; cin>>roll_no>>name>>class_st; cout<<"\nEnter marks in Computer,Physics,Maths,Chemistry and English:\n"; for(int i=0; i<5; i++) cin>>marks[i]; //accepting marks into an array percentage=calculate(); } float STUDENT::calculate() //calculating percentage { float s=0.0; for(int i=0; i<5; i++) s=s+marks[i]; return s/5; //returning percentage } void STUDENT::displaymarks() //function to display details { cout<<"\nRoll number: "<
//main function //creating object of class STUDENT //calling member functions