Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Practice Problem - Java Problem: You have been approached by the local convenience store to assist them with their inventory. They sell about 100 different

Practice Problem - Java Problem: You have been approached by the local convenience store to assist them with their inventory. They sell about 100 different products and currently have no way to keep track of the inventory. They have asked that you show them a sample of how you plan to solve the problem. You have decided that if would be best if you could create a class for each product they sell, and then use a main program to store an array of all products. You realize that there are some common values to all of the products sold. For example, all products have a UPC code for identification, product name, manufacturer, quantity in inventory, wholesale price, and a retail price. The management considers it very important that they can quickly know how many items they currently have for sale. This includes the total of all inventories for all products; as well just knowing how many different products the store carries (requires a static instance variable). What methods do you consider important to the problem? Make a list of instance variables and methods on another piece of paper. You decide that it would be helpful if you also created a few extended classes to show management. This will show them how quick and easy it will be to add new items to inventory. Pick two items that could be added to inventory in a convenience store and create the extended classes. Create two subclasses of products milk and ice cream. For milk, include the variables of size(Gallong, half gallont), and what kind of milk(Whole milk, 1% milk, 2% milk, skim milk) For ice cream, include the variable of size(pint, 1/2 pint, ounces), and what flavor(Vanilla, Chocolate, Strawberry). Create a driver class that an array of product: product[] inventory = new product[100];. This should be a menu driven program that should include loops, counters, and the following methods of: addToInventory removeFromInventory compareTo

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

Step: 3

blur-text-image

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

Principles Of Database Systems With Internet And Java Applications

Authors: Greg Riccardi

1st Edition

020161247X, 978-0201612479

More Books

Students also viewed these Databases questions

Question

6. How do histories influence the process of identity formation?

Answered: 1 week ago