Question
Vending Machine Business Problem Statement. The business's products are chips and sodas. They want us to write an app that stores their inventory and displays
Vending Machine Business Problem Statement. The business's products are chips and sodas.
They want us to write an app that stores their inventory and displays it to the user, including the unit price of each product, and how many items are left of the product. The user can then select a product, insert money (by keying in the amount), and get the selected item dispensed if the amount is right and if the product is not out of stock. The app must return the change if the amount entered is above the items unit price. The app must redisplay the updated inventory to allow the user to buy again. The app must update the amount of money that it has collected so far.
6 points @ 2 points each) The app has at least one superclass and two subclasses. Each class is complete with default constructor, custom constructor, get() methods(), set() methods(), toString(), and
at least two additional methods. Use the super reference as needed in the subclasses.
(2 points) The app uses an array to hold the inventory
(2 points) The app has a do..while menu that redisplays the inventory after each transaction
(4 points) The app has a method that takes an array as input and correctly displays the inventory (i.e., for each item, show the items name, quantity available, and price)
(4 points) The app has a method that takes an array as input and allows the user to make a purchase as outlined above (return change, cannot sell if out of stock, decrement inventory for each sale, update
amount of money collected) (2 points) The app catches and handles at least one of the following exceptions: NumberFormatException, ArrayIndexOutOfBoundsException, ArithmeticException
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started