Question: Project: Vending Machine g. Write a C.menu driven program to simulate a vending machine using functions. The 202 machine has the following items: hen name
Project: Vending Machine g. Write a C.menu driven program to simulate a vending machine using functions. The 202 machine has the following items: hen name Coke Ibem price Snickers Ches Mix Pepsi so.75 $0.55 30 60 0.90 Maximum capacity for each item is 30. Jtthe number of tems for each of the above is less than 5, then reaill t The machine accepts quarters, dimes, and nickels, and S1or $5 bills. There are three diferent containers for each coin. There should be at least 20 nickeis, 20 dimes, and 20 quarters in each container If each container has more than 100 coins, then remove coins from container and leave only 20 coins. If amount of $1 bills exceeds $100, then remove the $1 bills andl leave twenty $I bills in the container. If amount of $5 bills exceed $300, then remove $5 bills and leave twenty $5 bills in the container The cost of the items is 35% of the selling price. Labor cost is 25% of the selling price. 15 pro overhead is-of the seling price, Your program must run for six hours per day 35% . Your program must have at least the following functions 1. Main function 2. Menu function 3. Check If the machine is ON or Off 4. Turn the machine ON if it is OFF 5. Retil vending machine 6. Refill coins containers 7. Remove coins from any one of the container if it exceeds 100 coins 8. Select item from vending machine 9. Accept coins 10. Check for coin validity. If it is a foreign coin, then reject it. 11. Check the price. If the amount recelved is less than the item's price, then ask for more more yrthean unt receiveawmore-thamthe items price ther return cr ange 12. Retum change 13. Calculate the sales for each item per hour 4. Calculate the total sales for each item per day 15. Calculate the total sales for all items 16. Compute total cost of all items 17. Compute labor cost 18. Compute overhead 19. Compute profit 20. Display
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
