Answer to Question #29212 in C++ for bahar

Question #29212
Write a program that simulates a soft drink machine. The program should use a class that stores the following data members:
- Drink Name
- Drink Cost
- Count of Drinks in a Machine
and contains the following member functions:
- Constructor: inputs the name, cost and count of a drink in the machine from user
- Buy: receives the money amount as parameter, and gives out a can of the drink after checking whether there are any cans in the machine, and whether the user entered the correct amount of money. The function also outputs the amount of change returned to the user. Do not forget to update the appropriate data members.
- Print: outputs the current count of the drink in the machine.

The main program should ask the user what he/she wants to drink, and input the corresponding number of the drink as well as the user’s amount which will be sent as a parameter to the buy function. Then the print function should be called to output the current count of the drink. The program should continue until the user enters
1
Expert's answer
2013-04-26T08:29:51-0400

Unfortunately, your question requires a lot of work and cannot be done for free.
Submit it with all requirements as an assignment to our control panel and we'll assist you.

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS