Question
Consider a vending machine that offers the following options; 1) Get gum 2) Get Chocolate 3) Get Popcorn 4) Get juice 5) Display total sold
Consider a vending machine that offers the following options; 1) Get gum 2) Get Chocolate 3) Get Popcorn 4) Get juice 5) Display total sold so far 6) Quit Design and implement a program that continuously allows a user to select from these options. When options 1-4 are selected an appropriate message is to be displayed acknowledged their choice. For example, when option 3 is selected the following message could be displayed; "Here is your popcorn" When option 5 is selected, the number f each type of item sold is displayed. For example; 3 items of gum sold 2 items of chocolate sold 6 items of popcorn sold 9 items of juice sold When option 6 is chosen the program terminates. If an option other than 1-6 is entered an appropriate error message should be displayed such as; Error, options 1-6 only!
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