Answered step by step
Verified Expert Solution
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!
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
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