Question: HOW TO USE POINTER IN INVENTORY CLASS???? Write a C++ program to manage AN inventory. The program must do the following: 1. Allow entering new

HOW TO USE POINTER IN INVENTORY CLASS????

Write a C++ program to manage AN inventory. The program must do the following: 1. Allow entering new items into the program from the keyboard this identifies the items Johnny will sell, Book, CD, or DVD and the proper inventory record created for each one. The SKU (automatic number is the best option), number on hand, description and so-on, are initialized at this time. Some of these items will be updated when receiving an order. NOTE: some data members will reside in the base class and some in the derived classes (see below), and you must provide for appropriate member functions and data. 2. Receiving an order -- this means that the number of items received is entered into the program along with its cost per item and other pertinent details (see below). If there is a change in the cost, the new selling price is calculated. 3. Calculate the selling price of each item from its cost based on a markup. The markup for books is 25%, for CDs is 30% and for DVDs is 40%. Price = Cost + Cost * percentage 4. Sell an item. This means that the on hand is checked, and if there is enough merchandise, the sale is recorded by decrementing the number on hand by the number sold, computing the total price, including sales tax at 8.25%. Use a constant to store the tax percentage. If there is not enough inventory, sell whatever is available and issue a message. 5. Output a report of all items on hand, including their total dollar value (not total cost). Include a warning whenever there are fewer than 10 of an item currently on hand. For each item your inventory program must maintain the following: 1. When new items are created by using feature 1, assign an inventory number for the item. 2. For Books, maintain the title, author and short description. 3. For CDs maintain the title, artist name, number of tracks, playing time, and genre such as: Pop, Jazz, Rock, Country, Rap, etc. Make this open ended so new classifications can be entered. A text field will do. 2 4. For DVDs maintain the title, director, lead actor, playing time and genre such as: Drama, Comedy, etc.(a text field) 5. For all items, compute price based on cost and markup, keep count of the number on hand. The report called for by requirement 5 should output all information about each inventory item. You will need to take advantage of the capabilities of C++ classes, inheritance and polymorphism, including virtual functions. Program Design: 1. Create a class called Inventory that does the inventory. All data members have to be private. Your main function and any function that it calls should use the member functions of this class for all transactions. The other classes (below) are not directly referred to in the main function. 2. Create a class called Item which will serve as a base class for each of the several derived classes for Johnnys merchandise. The classes Book, DVD and CD will inherit this class. 3. The inventory class must maintain an array of pointers to Item objects to keep the inventory. Please do not use anything more sophisticated than an array. These pointers can point to Book, CD, and DVD objects. 4. Keep the program simple. I am not interested in how slick you can make it. I am interested in whether you can demonstrate basic competence in the use of classes, inheritance, virtual functions and good design. 5. Make your Item class an abstract base class. All data members in the classes Book, CD, DVD and Inventory must be private. This is to assure that you use the C++ capabilities that this assignment is all about. Do not use any global variables. NOTE: To test your project to turn in, I want to see several items of each type, book, CD, DVD created, an order received for each type item, and several sales recorded to verify the various transactions. Include at least one sale that tries to sell more of something than you have on hand to test that aspect of your program. Also include a report as per requirement 5 to complete the test. 3 This example gives you an idea how polymorphism works. 4 Output Example: Main Menu: 1) To enter a new item enter 1 2) To enter an order enter 2 3) For Sale enter 3 4) For a complete report enter 4 5) To quit enter 5 New Item: B) To add a new book enter B C) To add a new CD enter C D) To add a new DVD enter D M) To return to the main menu enter M B Enter title: Enter author: Enter description: . Enter cost: Order: Enter SKU for new order: Enter quantity received: .. Enter cost: Sale: SKU: . Quantity: 1 Next SKU or O to total: SKU: . Quantity: ... Next SKU or O to total: Receipt: 1008 2 $12.50 $25.00 (message if not enough) 1041 3 $21.00 $63.00 Total $88.00 Tax $7.70 Subtotal $95.70 Report: SKU 1001 (Book) Number on hand: 9 (Inventory is low, place an order) Cost: $12.45 Title: The Art of War Price: $15.56 Total $ value $140.04 Author: Sun Tzu Description: A book of strategy by a mysterious philosopher . SKU 1002 (CD) So on and so forth

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!