Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

See the UML diagram that goes along with this project. You must follow it 1 0 0 % , that include all the names used,

See the UML diagram that goes along with this project. You must follow it 100%, that include all the names used, parameters (amounts and types) etc.
Overall
The overall concept of this project is a point of sales program. The customer can purchase any items that are currently in stock. The customer should be able to purchase several different items at one time.
Exception
The exception should be thrown when an item is being added to the purchase list of items. It should check at that point if there are enough items to purchase. If there is not enough in the inventory, then the exception should be thrown. Handled correctly in main (program should not crash and customer should be able to continue).
CashRegister
Main interacts with this class only (except to create the initial inventory of items). Main populates the inventory via this class. The customer should see a menu of items that can be purchased. The customer will then start selecting items to purchase one at a time and determine when they are done. Information about the purchase should be displayed. Then the menu of the inventory is displayed again to allow the next customer to make a purchase. Uses a linked list to keep track of the items purchased for the customer. When an item has no more inventory it should be removed from the inventory and not displayed in the menu.
Inventory
Created by the CashRegister and populated via the CashRegister class. Provides methods to support keeping the inventory up to date. When adding an item to the inventory the add method must check to make sure the items do not already exist in the inventory. If already in the inventory, then do not add it.
All Electronics classes
This forms an inheritance hierarchy. Base(super) is abstract and implements the interface Comparing (see below). The description method just returns a generic message about the item, this is a hardcoded string.
Interface
The one method declared in the interface that the electronics implements is used to check if an item being added is already in the list. This prevents duplicate items being added to the inventory. Note this interface must also be a generic.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Time Series Databases New Ways To Store And Access Data

Authors: Ted Dunning, Ellen Friedman

1st Edition

1491914726, 978-1491914724

More Books

Students also viewed these Databases questions