Question: (c++) Given the following class definition: class Client string name; string address: float Balance; public: Client(); void setvals(string name, int, string address); void showClientInfo() const;

(c++) (c++) Given the following class definition: class Client string name; string address:

Given the following class definition: class Client string name; string address: float Balance; public: Client(); void setvals(string name, int, string address); void showClientInfo() const; int getPhone Number(); a) Modify the class according to the following: 1. Add suitable non-global integer data members named NumSoFar and NumLive. 2. The members above that keep track of Clients created so far and active Clients respectively. 3. Whenever a creation or deletion of an object occurs, display both numbers to keep user up to date. 4. Write the code for the showClientInfo function. 5. Create a function that compares me to another Client and returns True if my Balance is more, False otherwise 6. Create a friend function that compares two Clients and returns the one with the higher balance 7. Create a main program 7.1 Ask the user how many clients they wish to have, create an array of clients as the user specified - make sure this is less than 5 7.2 Create an array of 5 balance amounts, an array of 5 names and an array of 5 addresses 7.3 use the arrays in 7.2 to populate clients in 7.1 7.4 Print the original array of Clients - use NumSoFar and NumLive 7.5 Sort the array Client array according to Balance - use the function in point 5 above - also use NumSoFar and NumLive Notes Your code must be neat and with separate implementation and header files You must submit only 1 single .txt file with your name and id as comments in the file. Your file name should also include your name and id, c.g., 20189876-AhmadSalem-OOP- Asssignment2.txt

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!