Question: Lab 4.1 Use If and Switch statements Write a C++ program to immitating a vending machine. The program should present the user with a choice

Lab 4.1 Use If and Switch statements Write a C++ program to immitating a vending machine. The program should present the user with a choice of 10 products of your choice (Coke, Water, Chocolate Bar etc). Then allow the user to choose a product by entering a number 1-10. Add an exception for invalid input if the user inputs a number which doesn't correspond to any choice. fill the ... wih any product you want 1. Cola 2. Chocolate Bar 3. 4. 5. 6. 7. 8. 9. 10. User input:2 Output: Your have chosen a Chocolate Bar. User input: Choice: 11 Output: Error. Invalid choice
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
