Question
Complete P12.8 Need Comments throughout programs (Classes Name: Coin, CoinSet, Product, VendingMachine, VendingMachineMenu, VendingMachineSimulation), where this uses main to test the vending machine class. You
Complete P12.8 Need Comments throughout programs (Classes Name: Coin, CoinSet, Product, VendingMachine, VendingMachineMenu, VendingMachineSimulation), where this uses main to test the vending machine class. You will need to create an Exception class (given below): public class VendingException extends RuntimeException { public VendingException(String reason) { super(reason); } } Once complete, upload all .java files. For primary test class: Remember your header with name, date, and assignment. Also include class names that will be tested. Psuedocode (level 0 or mixture of level 0 and algorithm [do not number steps]) is required if main() contains more than simple statements (for example, your program includes constructs for decisions (if/else), loops, and methods. For Secondary class(es): Include a JavaDoc comment that describes the purpose of the class definition at the top of the file. Block level comments are required. You should comment anytime coding is not clear. That is just good programming. **Signal words: Prompt, Calculate, Display, Store (for arrays), Read (for files), If/Otherwise, Repeat
12.8
Write a program that simulates a vending machine. Products can be purchased by inserting coins with a value at least equal to the cost of the product. A user selects a product from a list of available products, adds coins, and either gets the product or gets the coins returned. The coins are returned if insufficient money was supplied or if the product is sold out. The machine does not give change if too much money was added. Products can be restocked and money removed by an operator. Follow the design process that was described in this chapter. Your solution should include a class VendingMachine that is not coupled with the Scanner or PrintStream classes.
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