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