Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Spatial Databases A Tour

Authors: Shashi Shekhar, Sanjay Chawla

1st Edition

0130174807, 978-0130174802

More Books

Students also viewed these Databases questions

Question

How to find if any no. is divisble by 4 or not ?

Answered: 1 week ago

Question

Explain the Pascals Law ?

Answered: 1 week ago

Question

What are the objectives of performance appraisal ?

Answered: 1 week ago