Use a member initialization list to make the TeamInfo constructor initialize the vector listOfPointsInSeason with a size of 6. Note: Including a vector in an initialization list causes that vector's...


Use a member initialization list to make the TeamInfo constructor initialize the vector listOfPointsInSeason with a size of 6. Note: Including a vector in an initialization list causes that vector's constructor to be called with the value in the parens.


#include
#include
using namespace std;


class TeamInfo {
   public:
      TeamInfo();
      void PrintGamesInSeason() const;


   private:
      vector listOfPointsInSeason;
};


TeamInfo::TeamInfo() : /* Your code goes here */ {
}


void TeamInfo::PrintGamesInSeason() const {
   cout < "there="" are="" "="">< listofpointsinseason.size()="">< "="" games="" in="" a="" season."=""><>
}


int main() {
   TeamInfo myTeam;


   myTeam.PrintGamesInSeason();


   return 0;
}


zy Section 4.12 - CIS 22B: Intermedi x<br>+<br>i learn.zybooks.com/zybook/DEANZACIS22BNguyenFall2021/chapter/4/section/12<br>vu<br>= zyBookS My library > CIS 22B: Intermediate Programming Methodologies in C++ home > 4.12: Constructor initializer lists<br>zyBooks catalog<br>? Help/FAQ<br>Uy Vu Lam<br>351182.2261528.qx3zqy7<br>Jump to level 1<br>1<br>Use a member initialization list to make the Teamlnfo constructor initialize the vector listOfPointsInSeason with a size of 6. Note:<br>Including a vector in an initialization list causes that vector's constructor to be called with the value in the parens.<br>1 #include <iostream><br>2 #include <vector><br>3 using namespace std;<br>4<br>5 class TeamInfo {<br>public:<br>TeamInfo();<br>void PrintGamesInSeason() const;<br>6.<br>7<br>8<br>9<br>private:<br>vector<int> list0fPointsInSeason;<br>10<br>11<br>12 };<br>13<br>14 TeamInfo::TeamInfo() : /* Your code goes here */ {<br>15 }<br>16<br>17 void TeamInfo::PrintGamesInSeason() const {<br>18<br>cout <«

Extracted text: zy Section 4.12 - CIS 22B: Intermedi x + i learn.zybooks.com/zybook/DEANZACIS22BNguyenFall2021/chapter/4/section/12 vu = zyBookS My library > CIS 22B: Intermediate Programming Methodologies in C++ home > 4.12: Constructor initializer lists zyBooks catalog ? Help/FAQ Uy Vu Lam 351182.2261528.qx3zqy7 Jump to level 1 1 Use a member initialization list to make the Teamlnfo constructor initialize the vector listOfPointsInSeason with a size of 6. Note: Including a vector in an initialization list causes that vector's constructor to be called with the value in the parens. 1 #include 2 #include 3 using namespace std; 4 5 class TeamInfo { public: TeamInfo(); void PrintGamesInSeason() const; 6. 7 8 9 private: vector list0fPointsInSeason; 10 11 12 }; 13 14 TeamInfo::TeamInfo() : /* Your code goes here */ { 15 } 16 17 void TeamInfo::PrintGamesInSeason() const { 18 cout <« "there="" are="" "=""><« listofpointsinseason.size()=""><« "="" games="" in="" a="" season."="">< endl; 19 } 20 21 int main() { 22 teaminfo myteam; 23 24 myteam. printgamesinseason(); 25 26 return 0; 27 } check next * endl;="" 19="" }="" 20="" 21="" int="" main()="" {="" 22="" teaminfo="" myteam;="" 23="" 24="" myteam.="" printgamesinseason();="" 25="" 26="" return="" 0;="" 27="" }="" check="" next="">
Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here