In: Computer Science
Represent the decision making involved in the operation of
the
following wash-machine by means of a decision table:
The machine waits for the start switch to be pressed. After the
user
presses the start switch, the machine fills the wash tub with
either hot
or cold water depending upon the setting of the HotWash switch.
The
water filling continues until the high level is sensed. The machine
starts
the agitation motor and continues agitating the wash tub until
either the
preset timer expires or the user presses the stop switch. After
the
agitation stops, the machine waits for the user to press the
startDrying switch. After the user presses the startDrying
switch,
the machine starts the hot air blower and continues blowing hot air
into
the drying chamber until either the user presses the stop switch or
the
preset timer expires.
Step 1 : Identify the Conditions :
Following are the various conditions which are used by the washing machine to make decision:
Step 2 : Identify the Actions :
Following are the various actions performed by the washing machine depending on the conditions and the rules:
Step 3 : Identify the Rules and Construct decision table :
Rules |
|||||||||
Conditions |
Start switch is pressed |
No |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Hot Wash switch is pressed |
Yes |
No |
|||||||
Water high level is sensed |
No |
No |
Yes |
||||||
Preset timer is expired |
No |
Yes |
No |
Yes |
No |
||||
Stop switch is pressed |
No |
No |
Yes |
Yes |
No |
||||
Start Drying switch is pressed |
Yes |
||||||||
Action |
Wait |
✔ |
✔ |
✔ |
✔ |
||||
Fill wash tub with hot Water |
✔ |
||||||||
Fill wash tub with cold water |
✔ |
||||||||
Agitate the wash tub |
✔ |
||||||||
Blow hot air into the drying chamber |
✔ |
Note : The Conditions marked in grey are those which will not affect the decision making in the given context. Here this is also assumed that the machine must be switched on for all other actions to take place else the machine will be simply in waiting state. Actions marked with ✔ is to performed on encountering a condition specified above it using a Yes/No entry.