Menu

[Solved]Design Implement C Program Buy Books Note Final Programming Assignment Requirements Overvi Q37200137

Design and implement a C++ program to buy books. Note that this is your final programming assignment. Requirements Overview:Details: This program must use a class called Book. This Book class must have a title, an author (first and last names), a foThe user then enters a number, based on which option the user wishes to do. The program must then conduct that option. Requir

Design and implement a C++ program to buy books. Note that this is your final programming assignment. Requirements Overview: This program has 3 classes and a main method Class 1: Book Contains Fields: title, authorFirst, authorLast, format, yearPublished, price Contains Functions: get functions for all above, set functions for all above. Constructor: one or more Class 2: Customer Contains Fields: fullName, shoppingCart, numOfBooks Contains Functions: enterName, addBook, displayBooks Class 3: MainClass Contains Fields: inventory Contains Functions: main Important note: Inventory is an array of Books in the MainClas:s shoppingCart is an array of Books in Customer Details: This program must use a class called Book. This Book class must have a title, an author (first and last names), a format (Hardcover, Paperback, Ebook, Audiobook), a publishing date, and a price NOTE: This should be a number since we will use it later to calculate the total cost of our purchases. All member data fields (variables) of ALL classes MUST be marked “private” (only accessible by functions of the class). If you are not sure what this means, feel free to ask . want you to do well As for member functions of the Book class, use one (or more) constructor functions for this class, and “Get” and “Set” functions for each data member (“Get” functions are functions that return a particular data member, “Set” functions are functions that use a parameter value to set the value of a particular data member) The program must also use a class called Customer. This class should contain the customer’s name, an array to hold a list of books (their “shopping cart”), and a count of the number of books in the shopping cart. This Customer class should have the following functions: 1. enterName (enter the customer’s name from the keyboard) 2. addBook (add a book from the store “inventory” array (see below) to the “shopping cart” array of books) displayBooks (display the list of books in the shopping cart with a total price.) 3. The main function will ask the user how many books are in the store, get the information for each book, and enter that information into each book. Each book must then be placed into an array of books, which will serve as a store “inventory.” The program will then create a single instance of the Customer class to serve as the customer Once the inventory and customer have been prepared, the program should display a menu with the following options 1. 2. 3. 4. 5. 6. Enter Customer name Add a book to a customer’s shopping cart Display the Customer’s shopping cart Search List all books Checkout The user then enters a number, based on which option the user wishes to do. The program must then conduct that option. Requirements for each option are below: Option 1 (Enter Customer Name) should allow the user to enter a name for the customer. It should be stored in the instance of the Customer Class. Option 2 (Add a book to customer’s shopping cart) should allow the user to add a book from the “inventory” array to the Customer’s “shopping cart” array. (It can be copied) Option 3 (Display the Customer’s shopping cart) should display all data in all books in the Customer’s “shopping cart” array. Option 4 (search) should allow the user to input a book title. The program should display all of the data from all of the books in the store “inventory” that contain that title. Option 5 (list all books) should print the entire store “inventory” Option 6 Should simply display the literal string “CHA CHING!” (or some other funny string, your choice) Show transcribed image text Design and implement a C++ program to buy books. Note that this is your final programming assignment. Requirements Overview: This program has 3 classes and a main method Class 1: Book Contains Fields: title, authorFirst, authorLast, format, yearPublished, price Contains Functions: get functions for all above, set functions for all above. Constructor: one or more Class 2: Customer Contains Fields: fullName, shoppingCart, numOfBooks Contains Functions: enterName, addBook, displayBooks Class 3: MainClass Contains Fields: inventory Contains Functions: main Important note: Inventory is an array of Books in the MainClas:s shoppingCart is an array of Books in Customer
Details: This program must use a class called Book. This Book class must have a title, an author (first and last names), a format (Hardcover, Paperback, Ebook, Audiobook), a publishing date, and a price NOTE: This should be a number since we will use it later to calculate the total cost of our purchases. All member data fields (variables) of ALL classes MUST be marked “private” (only accessible by functions of the class). If you are not sure what this means, feel free to ask . want you to do well As for member functions of the Book class, use one (or more) constructor functions for this class, and “Get” and “Set” functions for each data member (“Get” functions are functions that return a particular data member, “Set” functions are functions that use a parameter value to set the value of a particular data member) The program must also use a class called Customer. This class should contain the customer’s name, an array to hold a list of books (their “shopping cart”), and a count of the number of books in the shopping cart. This Customer class should have the following functions: 1. enterName (enter the customer’s name from the keyboard) 2. addBook (add a book from the store “inventory” array (see below) to the “shopping cart” array of books) displayBooks (display the list of books in the shopping cart with a total price.) 3. The main function will ask the user how many books are in the store, get the information for each book, and enter that information into each book. Each book must then be placed into an array of books, which will serve as a store “inventory.” The program will then create a single instance of the Customer class to serve as the customer Once the inventory and customer have been prepared, the program should display a menu with the following options 1. 2. 3. 4. 5. 6. Enter Customer name Add a book to a customer’s shopping cart Display the Customer’s shopping cart Search List all books Checkout
The user then enters a number, based on which option the user wishes to do. The program must then conduct that option. Requirements for each option are below: Option 1 (Enter Customer Name) should allow the user to enter a name for the customer. It should be stored in the instance of the Customer Class. Option 2 (Add a book to customer’s shopping cart) should allow the user to add a book from the “inventory” array to the Customer’s “shopping cart” array. (It can be copied) Option 3 (Display the Customer’s shopping cart) should display all data in all books in the Customer’s “shopping cart” array. Option 4 (search) should allow the user to input a book title. The program should display all of the data from all of the books in the store “inventory” that contain that title. Option 5 (list all books) should print the entire store “inventory” Option 6 Should simply display the literal string “CHA CHING!” (or some other funny string, your choice)

Expert Answer


Answer to Design and implement a C++ program to buy books. Note that this is your final programming assignment. Requirements Overv… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *