Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(C++) You MUST use do while loop to complete this exercise. Write a ptogram to simulate a simple vending machine. The program starts by asking

(C++) You MUST use do while loop to complete this exercise. Write a ptogram to simulate a simple vending machine. The program starts by asking the user to insert credit, which the user types, like this:

image text in transcribed

WARNING: You MUST use do-while loop to complete this exercise to receive points! Write a program to simulate a simple vending machine. The program starts by asking the user to insert credit, which the user types, like this Enter credit: user input here) After that, the program prints the following menu: Select option: 1 - Soda (1.00) 2 - Chips (1.00) 3 - Quit Until the user enters 3 (quit) or the balance falls below $1 and it is no longer possible to make a purchase. After one of these conditions is met, print the message Goodbye! And end the program. You can assume the initial credit will always be positive and the user will always make a valid selection (1.2 or 3)

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

Database Horse Betting The Road To Absolute Horse Racing 2

Authors: NAKAGAWA,YUKIO

1st Edition

B0CFZN219G, 979-8856410593

More Books

Students also viewed these Databases questions

Question

=+Now jump forward 10 years to project:

Answered: 1 week ago

Question

Why do HCMSs exist? Do they change over time?

Answered: 1 week ago