You are viewing a single comment's thread. Return to all comments →
class Student{ private: int scores[5]; public: void input(){ for(int i=0;i<5;i++){ cin>> scores[i]; } } int calculateTotalScore(){ int result = 0; for(int i=0;i<5;i++){ result += scores[i]; } return result; } }; /
Seems like cookies are disabled on this browser, please enable them to open this website
Classes and Objects
You are viewing a single comment's thread. Return to all comments →
class Student{ private: int scores[5]; public: void input(){ for(int i=0;i<5;i++){ cin>> scores[i]; } } int calculateTotalScore(){ int result = 0; for(int i=0;i<5;i++){ result += scores[i]; } return result; } }; /