3. Assume a building having three floor and a lift,
the lift has the following buttons:
a. G (for ground floor)
b. 1 (for first floor)
c. 2 (for the second floor)
d. 3 (for the 3rd floor)
e. Stop (Stop button to stop the lift in emergency)
Assume currently the lift is in the ground
floor; write an algorithm for the lift to work.