Question: 202 Project: Vending Machine 9. Write a C+- menu driven program to simulate a vending machine using functiors. The vending machine has the following items:
202 Project: Vending Machine 9. Write a C+- menu driven program to simulate a vending machine using functiors. The vending machine has the following items: Item price Dontos o 75 so.55 Chex Mix Pepsi Maximum capacity for each item is 30 Itthe number or items for each of the above is less than 5 then renil The machine accepts quarters, dimes, and nickels, and $1 or $5 bills. There are three ditferent containers for each cojn. There should be at least uarters in each container. If each container has more than 100.coins and leave twenty 1 bills in the containe 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. Overhead is 5% of the selling price. Your program must run for six hours per day 20 dimes, and2 then remove cons from d leave only 20 coins, If amount of s1 bills exceeds $100 then emove the $1 bills s exceed $300 35% is prof Your program must have at least the following functions: 1. Main function 2. Menu function 3. Check ir the machine is ON or ofr 4. hur the machine ON if it is OFF Retll vending machine Refill coins containers Remove coins from any one of the container if it exceeds 100 coins Select item from vending machine 5. 6. 7. 8. 9. Accept coins 10. Check for coin validity. If it is a foreign coin, then reject it. 11. Check the price. If the amount received is less than the tem's price, then ask for more nmoney. f the amount received is more 'than the item's price, then return change 12. Return change 13. Calculate the sales for each item per hour 14. 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
