Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
image text in transcribed
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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Expert Systems Applications Dexa 2023 Workshops 34th International Conference Dexa 2023 Penang Malaysia August 28 30 2023 Proceedings

Authors: Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil ,Bernhard Moser ,Atif Mashkoor ,Johannes Sametinger ,Maqbool Khan

1st Edition

ISBN: 303139688X, 978-3031396885

More Books

Students also viewed these Databases questions

Question

What are some of the possible scenes from our future?

Answered: 1 week ago