Question: please create a c++ code to implement the simple logic . The vending machine controller accepts three U.s. coins: the nickel (5C), the dime (10
The vending machine controller accepts three U.s. coins: the nickel (5C), the dime (10 C) and the quarter (25c). When the value of the inserted coins equals or exceeds 20C, then the machine dispenses the merchandise, returns any excess money, and waits for the next transaction. We begin by constructing a state transition diagram, as shown below: I/0 = Dispense/Do not dispense merchandise 1/0 Return/Do not return a nickel in change A dime is 110 10 Return/Do not N/100 D/110+_ return a dime in change N/000 15 e N = Nickel D Dime Q Quarter D/100 10 e Fig.1: State Transition Diagram
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
