Menu

Expected Output Name Lee Chong Lin Number Nateh Von Number Match Lost Incone Earned Lee Ch Q43863084

Expected output Name Lee Chong Lin Number of nateh von Number of match lost @ Incone earned Lee Chong Lin von 4 and lost 1 Naclass player { public: Player() () Player(string name, int age); //1 mark m name , nane.masse void showPlayerInfo(); // 1 marExpected output Name Lee Chong Lin Number of nateh von Number of match lost @ Incone earned Lee Chong Lin von 4 and lost 1 Nanet Lee Chong Lin Age : 35 Number of nateh von 14 Number of match lost: 1 Incone earned 1 3989 Lee Chong Lin can win over Moneto In order to exceed the income RM200 Lee Chong Lin need to win minimum 4 more games with no lost Figure Q1.2 Implement all the member functions in the Counter class so that the output in the main() function is similar to Figure Q1.2 Note: The name of the variable represent the information it stores No Member function Remark Player(string name, int age); // Initialize the member variable name and mark m_age based on input argument of the constructor 2 void showPlayerInfo() // 1 mark Show the player information is displayed in Figure 21.2 float get Income(); // 1 mark Get the income of the player The player earn RM1000 for every win and RM100 deducted from the income for very game lost. 4 string getName(); // 1 mark Retrieve the member variable m nane 5 void getNumWinLost(int& nwin, int& Retrieve the number of games won (win) and nlost); // Imark lost (nlost). Use pass by reference to obtain the information 6 void incrementWin(); // 1 mark Increment nun in by 1 for every game won void incrementlostO; // 1 mark Increment m_numLost by 1 for every game lost static bool comparePlayer(Player pl, Return true if player pi has more won more Player p2); // 1 mark matches than player p2. Else it return false. 9 int getNumWinToEarn(float Compute and return the minimum number of games desired Income); // 2 marks that need to be won in order to exceed desired Income. Use m_income as starting income. class player { public: Player() () Player(string name, int age); //1 mark m name , nane.masse void showPlayerInfo(); // 1 mark float get Income(); // 1 mark string getName(); // 1 mark void getNumWinLost(int& nwin, int& nlost); // Imark void incrementwin); // 1 mark void incrementlost : // 1 mark static bool comparePlayer(Player pl, Player p2); // 1 mark int get NumWinToEarn(float desired Income); // 2 marks private: string m_name; int mage: float m_income; int m_numwin; int m_numLost; int main() { Player pi(“Lee Chong Lim”, 35); pi.showPlayerInfo(); for (int i = 0; i < 4; i++) { pl. incrementWin(); pi.incrementLost(); int numWin, numLost; pi.getNumWinLost(numin, numLost); cout << endl << pi.getName() << ” won ” << numWin << ” and lost” << numLost; pi.getIncome(); p1.showPlayerInfo(); Player p2(“Momoto”, 29); if (Player::comparePlayer(p1, p2)) { cout << endl; cout << pl.getName() <” can win over ” << p2.getName(); int numWinRequired – pi.getNumwinToEarn(7000); cout << endl << “n In order to exceed the income RM7000 n ” << pi.getName(); cout << ” need to win additional ” << numWinRequired << ” games with no lost “; getchar(); return ; Figure Q1.1 Show transcribed image text Expected output Name Lee Chong Lin Number of nateh von Number of match lost @ Incone earned Lee Chong Lin von 4 and lost 1 Nanet Lee Chong Lin Age : 35 Number of nateh von 14 Number of match lost: 1 Incone earned 1 3989 Lee Chong Lin can win over Moneto In order to exceed the income RM200 Lee Chong Lin need to win minimum 4 more games with no lost Figure Q1.2 Implement all the member functions in the Counter class so that the output in the main() function is similar to Figure Q1.2 Note: The name of the variable represent the information it stores No Member function Remark Player(string name, int age); // Initialize the member variable name and mark m_age based on input argument of the constructor 2 void showPlayerInfo() // 1 mark Show the player information is displayed in Figure 21.2 float get Income(); // 1 mark Get the income of the player The player earn RM1000 for every win and RM100 deducted from the income for very game lost. 4 string getName(); // 1 mark Retrieve the member variable m nane 5 void getNumWinLost(int& nwin, int& Retrieve the number of games won (win) and nlost); // Imark lost (nlost). Use pass by reference to obtain the information 6 void incrementWin(); // 1 mark Increment nun in by 1 for every game won void incrementlostO; // 1 mark Increment m_numLost by 1 for every game lost static bool comparePlayer(Player pl, Return true if player pi has more won more Player p2); // 1 mark matches than player p2. Else it return false. 9 int getNumWinToEarn(float Compute and return the minimum number of games desired Income); // 2 marks that need to be won in order to exceed desired Income. Use m_income as starting income.
class player { public: Player() () Player(string name, int age); //1 mark m name , nane.masse void showPlayerInfo(); // 1 mark float get Income(); // 1 mark string getName(); // 1 mark void getNumWinLost(int& nwin, int& nlost); // Imark void incrementwin); // 1 mark void incrementlost : // 1 mark static bool comparePlayer(Player pl, Player p2); // 1 mark int get NumWinToEarn(float desired Income); // 2 marks private: string m_name; int mage: float m_income; int m_numwin; int m_numLost; int main() { Player pi(“Lee Chong Lim”, 35); pi.showPlayerInfo(); for (int i = 0; i

Expert Answer


Answer to Expected output Name Lee Chong Lin Number of nateh von Number of match lost @ Incone earned Lee Chong Lin von 4 and lost…

OR