Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

MySQL Crash Course A Hands On Introduction To Database Development

Authors: Rick Silva

1st Edition

1718503008, 978-1718503007

More Books

Students also viewed these Databases questions

Question

3. What might you have done differently

Answered: 1 week ago

Question

What does Processing of an OLAP Cube accomplish?

Answered: 1 week ago