You are viewing a single comment's thread. Return to all comments →
C++
class Student { public: Student(); void input(); int calculateTotalScore(); private: int score[5]; }; Student::Student(){} void Student::input() { for(int i =0; i<5; i++) { cin>>score[i]; } } int Student::calculateTotalScore() { int sum =0; for(int i =0; i<5; i++) { sum +=score[i]; } return sum; }
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 →
C++