Question: Design and implement a C + + program that mimics the operations of a vending machine that dispenses four different types of snacks. [ STEP

Design and implement a C++ program that mimics the operations of a vending machine that dispenses four different types of snacks.
[STEP1] This program uses a 'class' definition for vending machine ("SnackMachine"), and within it must implement four functions; one each for a choice of snack. The functions are only required to print a statement on screen saying that the snack is dispensed.
[STEP2] Once you code down your class, next implement the main() function. Your main function declares an object of type "SnackMachine", and uses this object to call various functions to dispense snacks. Use a while(1) and switch-statement to present a menu of snacks, prompt the user to make a choice, and call the appropriate function.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!