Question: 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!

Java programming. Thanks! Program 2 (25 points): Write a program that simulates

a vending machine. The machine holds six items of your choice (you

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!