Question: Write a program that simulates a vending machine. The user will be prompted to enter a letter then a number. As part of the prompt
Write a program that simulates a vending machine. The user will be prompted to enter a letter then a number. As part of the prompt you must display a message to indicate the number and letter, along with the possible choices. That is, what selections will give user which item. If the user enters a number or a letter that is not valid, then display the message Bad Entry and end the program.
Selections with messages.
a1 - display the message Here are your chips
a2 - display the message Here is your soda
b1 display the message Here is your candy bar
b2 display the message Here is your popcorn
Sample display
This is a vending machine.
Here are your choices.
a1 - chips
a2 - soda
b1 - candy bar
b2 - popcorn
Enter letter: a
Enter number: 2
Here is your soda.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
