Question: C++ CODING ARGENT PLEASE Question 1: Implement the following Mall as described below: Each Mall contains a number of shops; Implement class Mall with the

C++ CODING ARGENT PLEASE  C++ CODING ARGENT PLEASE Question 1: Implement the following Mall as
described below: Each Mall contains a number of shops; Implement class Mall

Question 1: Implement the following Mall as described below: Each Mall contains a number of shops; Implement class Mall with the following: 1. Three private data member: (6 points) a. int maxSize b. int current to track the current number of shops in the Mall. This attribute gets modified whenever a shop is inserted or removed from list c. string "list a pointer a dynamic array of strings that represent the names of the shops 2. The following public member functions: (54 points): Use this pointer in all member function of the class that take one or more parameters. a. Mallint maxSize): creates an empty Mall and sets maxSize to s. b. Deep Copy Constructor. c. Mallo: Deallocate the list. disEmpty0, a boolean function that returns true if current == 0. and false otherwise. c. isFullo), a boolean function that returns true if current == maxSize, and false otherwise. fint find(string shop) returns the index of shop if found in list, otherwise returns -1. HINT: use string compare function from the string library. 9. void insert(string shopname)this function does the following: 1. Inserts shop into the end of the list in the Mall, if both the Mall is not full and shopname does not exist in list. 11. If shopname to be inserted is already in list, then print a message saying the shop won't be inserted because it already exists in list. 111. If shopname is not in list, but list is full, then print a suitable message to say that the insert operation failed h. void printMallo): prints the names of the shops currently in the Mall alongside their number index). 1. Setter and getter for maxSize 3. getter for current data member. k. float occupation) that calculates the percentage of opened shops in the Mall (hint: occupation is 100*current/maxSize). Make sure that the division is a floating-point division I make all the member functions that do not change or modify data constant. 3. Define friend function void Soldout(Mall& obj, int i); if the Mall is not empty and if the index (i) is between 0 and current-1, inclusive, it removes the i shop from list in Mall and shifts remaining shops to left to fill the gap. Otherwise, it prints a message that indicate if the Mall is empty or the index (i) is out of range, Question 2 (40): Write a driver program to test the class you have implemented, where you will: 1. Create an array of strings named my_shops of size 10 and fill it from the user. 2. Create a Mall object named M1 with maxSize 10 and fill the first 4 entries in its list using the values from my_shops array. 3. Print the number of shops in M1 with same name as the last shop name from my_shops array, 4. Remove the second shop from list in M1 (use the soldout function). 5. Print the occupation of Mi. 6. Display the details of MI. 7. Write the code to ask the user of how many Mall objects he/she want to create, then create an array of Mall based on his input

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!