volume_mute

State Diagram for a Filling Station System

publish date:Β 1969/12/31 00:00:00 UTC

volume_mute

A fully automated filling (gas) station requires a state diagram. A driver swipes a card, credit is verified, fuel is dispensed, and the account is debited after the hose is returned. Which of the following represents the correct sequence of states?

Correct Answer

Idle β†’ CardReading β†’ CardVerification β†’ FuelAuthorized β†’ Fuelling β†’ HoseReturned β†’ Billing β†’ CardReturned β†’ Idle

Explanation

The filling station state machine: Idle (waiting for a customer) β†’ CardReading (card swiped through reader) β†’ CardVerification (communication with credit company, fuel limit established) β†’ FuelAuthorized (card valid, pump enabled) β†’ Fuelling (driver takes fuel) β†’ HoseReturned (hose returned to holster) β†’ Billing (account debited for cost of fuel taken) β†’ CardReturned (valid card returned; if invalid, card returned before fuelling) β†’ Idle. If the card is invalid, the pump returns the card before fuel is dispensed.

Reference

Software Engineering, Ian Sommerville, 10th edition


Quizzes you can take where this question appears