Question: In this exercise, you will design a class memberType. The class has the following data members: memberName. A string that holds the name of a
In this exercise, you will design a class memberType. The class has the following data members: memberName. A string that holds the name of a person memberID. A string that holds the member identification number numBooks. An int that holds the number of books bought purchaseAmt. A double that holds the amount spent on books In addition, the class should have the following constructor and other member functions. Constructor. The constructor should accept the persons name and member identification number. These values should be assign to the objects memberName and memberID data members. The constructor should also assign 0 to numBooks and purchaseAmt. Accessor. Appropriate accessor function to get the values stored in an objects memberName, memberID, numBooks, and purchaseAmt data members. addNewPurchase. The addNewPurchase function should accept the number of books for a new purchase and the total amount of the purchase in dollars. The function should add these values to the existing numBooks and purchaseAmt data member. Demonstrate the class in a client program that creates a memberType object and then calls the display the members id and name along with the current number of books and current purchase amount addNewPurchase function twice (representing 2 new purchases). After each new purchase,. I need to turn this into a zip file in the end!
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
