Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java programming. Thanks! Program 2 (25 points): Write a program that simulates a vending machine. The machine holds six items of your choice (you can

Java programming. Thanks!

image text in transcribed

image text in transcribed

Program 2 (25 points): Write a program that simulates a vending machine. The machine holds six items of your choice (you can label them 1 through 6, or a through e). Each item has a corresponding price. The program should display a menu of items and ask the user to enter the item he/she wants to purchase along with a sum of money. If the money is enough to buy the item, your program should display the name of item purchased along with the change owed to the user (if any) If the money inserted is insufficient, then your program should say so and let the user know how much additional money is needed. Your program must display the money amounts using currency format. If the user enters an invalid choice, your program should alert the user of the error Here are a few sample runs (his is only for example purposes, your ouput does not need to look like mine)

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

Modern Database Management

Authors: Jeffrey A. Hoffer Fred R. McFadden

4th Edition

0805360476, 978-0805360479

More Books

Students also viewed these Databases questions

Question

3. Is there opportunity to improve current circumstances? How so?

Answered: 1 week ago