Your supervisor has assigned you to build a finite state machine (FSM) in C code to control the o…
Your supervisor has assigned you to build a finite state machine (FSM) in C code to control the operation of a gas pump. You determine that the required states are: . idle, payment card verifying payment approved, payment denied, nozzle removed, waiting for grade selection, e pumping. finalizing transaction (i.e. the nozzle has been returned) . emergency (someone drove off before removing the nozzle, fire detected, etc. The first thing you decide to do is to create a custom C data type to represent the states. Using the typedef keyword, create your custom data type in the answer space
Following is the custom type created using the keyword typedef
in C. If the combination of these states and triggered event match,
the corresponding event handler is called..
//Different states of Gas Pump using typedef
//Prototype of event handlers