Question: Write a program that simulates a vending machine. The program should display the message This is a vending machine - What is your selection? Then
Write a program that simulates a vending machine. The program should display the message "This is a vending machine What is your selection?" Then display the following menu.
a chocolate bar cents
b potato chips cents
a popcorn cents
b sweet tarts cents
Then display the message "Enter a coin:". This could be or
If the user entered the exact amount, then display message "Here is the
If the user entered more than required, then display message "Here is the and your change is
If the user entered less than what is required, then display message "Sorry, not enough money"
Compile and test your code. Submit your java file through Blackboard.
Notes:
For the selection the user only enters aba or b
is what the user selected.
is change from the coin that was entered.
Attach File
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
