Question
Construct a candy vending machine. Each piece of candy costs 25 cents. The machine accepts quarter, dimes and nickels only. You should have a start
Construct a candy vending machine. Each piece of candy costs 25 cents. The machine accepts quarter, dimes and nickels only. You should have a start and stop (candy), Each state should reflect how much money the machine has accepted. For instance, you put a dime and a nickel into the machine, the current state should be 15 cents with 10 cents to go. Each arrow is a transition. It should have labels that reflect the next coin that is placed into the machine. If we need 10 cents for candy, we can accept a dime or two nickels. RULE: If you pay too much, you need not return change in the state diagram.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started