The video store has expanded and now also sells used books and toys in addition to DVDs. Modify your Java program from assignment 1 (or the solution available on TRACS) to handle these different types of products in the inventory.
The inventory for the store will contain the following information for each product in the
inventory: SKU
title
price quantity
(may contain spaces in it)
(dollars and cents, greater than 0)
(number of copies in inventory, greater than or equal to 0)
For movies (dvds) a upc (universal product code) is stored
For books, an isbn (international standard book number) and author name are stored. For toys, the weight (in total ounces!!) is stored
(stock-keeping unit, an integer, must be unique)
In addition to these attributes, the following are stored for each product type:
The program should offer the user a menu with the following options (changes from assignment 1 are in bold):
1. Add a product to the inventory (user should enter a letter (M or B or T) to indicate the product category and then input corresponding values). Please prompt for the values as the same order as the sample output online.
For #3, display all the attributes for the product (this will differ for each category).
For #4, display only the product category (Movie, Book, or Toy), sku, price, quantity, and title for each product (attributes they have in common).
The details of #5 Process a sale are given below.
Your program should store the inventory in a file between executions of the program, so that when the program is run again it will start up with the same inventory contents as when it last terminated.
5. Process a sale
The products are offered for sale on Amazon, which charges a commission on each sold item, and refunds a shipping credit to the store for each sold item (the store must ship the items offline and pay their own shipping costs).
To process the sale of a certain product, the user must input the following:
sku of the product sold
Your program should update the quantity attribute for that product in the inventory, if there are enough items of that product in the inventory. If not, it should issue an error message and abort the operation. Do NOT remove the product from the inventory.
The shipping credit and commission that Amazon charges for each type of item of are shown below. Note that for toys, the shipping credit depends on the weight (in pounds, rounded up) of the item. So for a toy weighing 18 ounces, the shipping credit is
Get Free Quote!
424 Experts Online