Presentation is loading. Please wait.

Presentation is loading. Please wait.

NFA: Vending Machine Simulation

Similar presentations

Presentation on theme: "NFA: Vending Machine Simulation"— Presentation transcript:

1 NFA: Vending Machine Simulation
Steven Stockall

2 Intro NFA-Nondeterministic Finite Automaton - several possible states from current state, type of finite state machine Goals: Create a function NFA that works in a simulation Gain a greater understanding to the use of and applications for finite state machines Applications: Vending Machine Elevator Circuit hardware

3 Design Machine accepts dimes, nickels, and quarters
Monetary cap of $1 Monetary states for all valid change inputs Several purchase options: Purchase items will vary in price Invalid selections will return to current monetary state with prompt stating invalid selection Valid selections will drop item and return correct change ‘coin return’ button: Returns change Overflow: Monertary input over $1 will be handled with an overflow state, this returns the amount of change equal to the amount over $1 entered into the machine by the user

4 Design (cont.) Code: Design will be implemented in C#
Design will have a small user interactive window with which the user can interact with and test the program

5 Code Organization Main that starts the core program Core:
Program starts with a $.00 state based on user input will call one of the modules passing in the user input and the old state modules will return new state Module that handles monetary selection: overflow will be handled within module Module that handles item selection: invalid selections return same state valid selections return item adjust change amount and returns remaining change then returns to $.00 state Module that handles coin return: Returns coins Returns to $.00 state

6 Testing Correct State transition: Correct State chaining:
test to check state to state transition Correct State chaining: test to check state transitions are correct for long transition chains Correct input handling: Buttons work properly Correct cash overflow handling: purposely test all possible overflow states

7 Conclusion Goals: will be to see how a NFA works in real world applications create a functioning NFA create a workable vending machine simulation

Download ppt "NFA: Vending Machine Simulation"

Similar presentations

Ads by Google