Question: Create a C++ program. Create a vending machine simulation program using C++. The program should have 5 products total, each product must have a price,
Create a C++ program.
Create a vending machine simulation program using C++.
- The program should have 5 products total, each product must have a price, name, and the quantity currently in stock.
- The program should have a menu that displays the product's price, name, and quantity currently in stock, the program must also have an option to exit.
- The program should allow the user to choose an item that is currently in stock for purchase, or to exit the program.
- The program should collect payment.
- The program should display change when appropriate.
- The program should decrement the quantity of the product purchased from currently in stock.
- Upon exiting the program, it should display the total number of items purchased and the total amount spent.
#include
using namespace std;
int main(){
// Code goes here
// More code outside of the int main may be added
return 0; }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
