Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C++ menu driven program to simulate a vending machine using functions. The vending machien has the following items(In the table) Maximum capacity for

image text in transcribed Write a C++ menu driven program to simulate a vending machine using functions. The vending machien has the following items(In the table)

Maximum capacity for each item is 30.

If the number of items for each of the above is less than 5, then refill it.

The machine accepts quarters, dimes and nickles, and 1$ or 5$ bills. There are three different containers or each coin. There should be atleast 20 nickes, 20 dimes and 20 quarters in each container. If each container has more than 100 coins, then remove coins from container and leave onyl 20 coins. If amount of 1$ bills exceeds 100$, then remove 5$ bills and leave twenty 5$ bills in the container.

The cost of 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.

Your program must have at least the following functions:

-"Main function, Menu function, chef i the machine is on or off, Turn the machine on if its off, refill vending machine, refill coins in containers, remove coins from any one of the container if it exceeds 100 coins, Select item from vending machine, Accept coins, Check for coin validity(If it is foriegn, then reject), Check the price.(If the amount recieved is less than the item's price, then ask for more money. If the amount recieved is more than teh item's price, then return change.) Return Change, Calculate sales for each item per hour, Calculate total sales for each item per day, Calculate the total sales for all items. Compute total cost of all items, Compute labor cost, Compute overhead, Compute profit, Display."

9. Write a C44 menu driven program to siitilate a vencding nschine using furvctiocs. The vending machine has the following kems Item price S0.95 $0.75 $0.ss $0.60 S0.90 Item name Doritos Snickers Chex Mix Pepsi Maximum capacity for each item is 30 If the number of items for each od the abene is less than 5, then refill it. The machine accepts quarters, dimes, and nickels, and SI or 35 bills. There are three different containers Sor eachi coin. There shoukd be at least 20 nickels, 20 dimes, and 20 quarters In each container. If each container bais more than 100 cnins, then remove coins from container and leave only 20 coms. Ir amount of $1 bills exceeds $100, then remove the $1 bills and leave twenty &I bills in the container. IT amount of So hills exceed 8300, then remove 85 bills and lesave twenty 85 Tills in the container The cost of the itess is 35% of the selling pnce. Labor cost is 2% of the selling price. Overhead is 5% of the selling price. Your program must nin for six hours per day Your prugram must have at least the following functikns L. Main function 2. Menu function 3. Check if the machine is ON or of 4. Turn the machine ON If it is OFF 5. Refll vending machine 6. Refill coins containers 7. Remove colns from any one of the container if it excesds 100 coins 8. Seleet item fromm vending machine 9, Accept coins 10. Check for coin validity, Ifit Is a foneign coin, then reject it. 11. Check the price. If the atnount received is less than the item's price, then ask for mure money, If the amount received is more than the item's price, then returin change 12. Return change 13. caleulate the sales for eachi item per hour 9. Write a C44 menu driven program to siitilate a vencding nschine using furvctiocs. The vending machine has the following kems Item price S0.95 $0.75 $0.ss $0.60 S0.90 Item name Doritos Snickers Chex Mix Pepsi Maximum capacity for each item is 30 If the number of items for each od the abene is less than 5, then refill it. The machine accepts quarters, dimes, and nickels, and SI or 35 bills. There are three different containers Sor eachi coin. There shoukd be at least 20 nickels, 20 dimes, and 20 quarters In each container. If each container bais more than 100 cnins, then remove coins from container and leave only 20 coms. Ir amount of $1 bills exceeds $100, then remove the $1 bills and leave twenty &I bills in the container. IT amount of So hills exceed 8300, then remove 85 bills and lesave twenty 85 Tills in the container The cost of the itess is 35% of the selling pnce. Labor cost is 2% of the selling price. Overhead is 5% of the selling price. Your program must nin for six hours per day Your prugram must have at least the following functikns L. Main function 2. Menu function 3. Check if the machine is ON or of 4. Turn the machine ON If it is OFF 5. Refll vending machine 6. Refill coins containers 7. Remove colns from any one of the container if it excesds 100 coins 8. Seleet item fromm vending machine 9, Accept coins 10. Check for coin validity, Ifit Is a foneign coin, then reject it. 11. Check the price. If the atnount received is less than the item's price, then ask for mure money, If the amount received is more than the item's price, then returin change 12. Return change 13. caleulate the sales for eachi item per hour

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions