a. In the first part of this exercise, you will design a class memberType.
i. Each object of memberType can hold the name of a person, member ID, number of books bought, and amount spent.
ii. Include the member functions to perform the various operations on the objects of memberType —for example, modify, set, and show a person’s name. Similarly, update, modify, and show the number of books bought and the amount spent.
iii. Add the appropriate constructors and a destructor (if one is needed).
iv. Write the definitions of the member functions of memberType .
b. Using the classes designed in Programming Exercise and part (8a), write a program to simulate a bookstore. The bookstore has two types of customers: those who are members of the bookstore and those who buy books from the bookstore only occasionally. Each member has to pay a $10 yearly membership fee and receives a 5% discount on each book bought.
For each member, the bookstore keeps track of the number of books bought and the total amount spent. For every eleventh book that a member buys, the bookstore takes the average of the total amount of the last 10 books bought, applies this amount as a discount, and then resets the total amount spent to 0.
Your program should contain a menu that gives the user different choices to effectively run the program; in other words, your program should be self-driven.
Programming Exercise
a. Some of the characteristics of a book are the title, author(s), publisher, ISBN, price, and year of publication. Design the class bookType that defines the book as an ADT.
Each object of the class bookType can hold the following information about a book: title, up to four authors, publisher, ISBN, price, and number of copies in stock. To keep track of the number of authors, add another data member.
Include the member functions to perform the various operations on the objects of bookType . For example, the typical operations that can be performed on the title are to show the title, set the title, and check whether a title is the same as the actual title ofthe book. Similarly, the typical operations that can be performed on the number of copies in stock are to show the number of copies in stock, set the number of copies in stock, update the number of copies in stock, and return the number of copies in stock. Add similar operations for the publisher, ISBN, book price, and authors. Add the appropriate constructors and a destructor (if one is needed).
b. Write the definitions of the member functions of the class bookType .
c. Write a program that uses the class bookType and tests the various operations on the objects of class bookType . Declare a vector container of type bookType . Some of the operations that you should perform are to search for a book by its title, search by ISBN, and update the number of copies in stock.
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.