Use a member initialization list to make the GamePoints' constructor assign teamGrizzlies with 500 and teamLions with 500.
#include using namespace std;class GamePoints { public: GamePoints(); void Start() const; private: int teamGrizzlies; int teamLions;};GamePoints::GamePoints() :/* Your code goes here */{}void GamePoints::Start() const { cout < "game="" started:="" grizzlies="" "="">< teamgrizzlies="">< "="" -="" "="">< teamlions="">< "="" lions"=""><>}int main() { GamePoints myGame; myGame.Start(); return 0;}Extracted text: zy Section 4.12 - CIS 22B: Intermedi x B Use a member initialization list to X O Gmod Prop Hunt Funny Mon X + A learn.zybooks.com/zybook/DEANZACIS22BNguyenFall2021/chapter/4/section/12?content_resource_id=49379227 * ES vu = zyBookS My library > CIS 22B: Intermediate Programming Methodologies in C++ home > 4.12: Constructor initializer lists zyBooks catalog ? Help/FAQ Uy Vu Lam CHALLENGE 4.12.2: Writing constructors. ACTIVITY 351182.2261528.qx3zgy7 Jump to level 1 1 Use a member initialization list to make the GamePoints' constructor assign teamGrizzlies with 500 and teamLions with 500. 1 #include 2 using namespace std; 3 4 class GamePoints { public: GamePoints(); void Start() const; 7 8 private: int teamGrizzlies; int teamlions; 10 11 12 }; 13 14 GamePoints::GamePoints() :/* Your code goes here */{ 15 } 16 17 void GamePoints::Start() const { 18 cout <« "game="" started:="" grizzlies="" "="">«>< teamgrizzlies=""><« " - " « teamlions « " lions" « endl; 19 } 20 21 int main() { 22 gamepoints mygame; 23 24 mygame.start(); 25 26 return 0; 27 check next "="" -="" "="" «="" teamlions="" «="" "="" lions"="" «="" endl;="" 19="" }="" 20="" 21="" int="" main()="" {="" 22="" gamepoints="" mygame;="" 23="" 24="" mygame.start();="" 25="" 26="" return="" 0;="" 27="" check="">« " - " « teamlions « " lions" « endl; 19 } 20 21 int main() { 22 gamepoints mygame; 23 24 mygame.start(); 25 26 return 0; 27 check next>
class GamePoints { public: GamePoints(); void Start() const;
private: int teamGrizzlies; int teamLions;};
GamePoints::GamePoints() :/* Your code goes here */{}
void GamePoints::Start() const { cout < "game="" started:="" grizzlies="" "="">< teamgrizzlies="">< "="" -="" "="">< teamlions="">< "="" lions"=""><>}
int main() { GamePoints myGame;
myGame.Start();
return 0;}
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here