Question: Write a program to simulate a vending machine with the following characteristics: - The machine sells sodas, and a soda is 1 5 cents. -

Write a program to simulate a vending machine with the
following characteristics:
- The machine sells sodas, and a soda is 15 cents.
- The machine does not provide change.
- The user is expected to provide either Dimes or Nickels.
- The machine can be in one of the following states:
- State 1: No coins
- State 2: 5 cents (N)
- State 3: 10 cents (D)
- State 4: Dispensing soda
- Your program should ask for a coin and show the current
state of the machine. Also, you need to display the moment
when a soda is being dispensed. Your need to draw and
implement the corresponding state machine to implement

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!