Professional Documents
Culture Documents
Algortihm (Amusment Park)
Algortihm (Amusment Park)
Algortihm (Amusment Park)
120cm tall OR weigh at least 45kg. A machine is installed out the ride
entrance that automatically measure a person height and weight. It
displays a message. Ride OK or No ride.
I P O
Height
Weight
Calculate ride (2120cm) or
45) or no ride ( 120 or 45kg)
(Message) Ride OK or
No Ride
PeseudoCode
Begin
Accept CWHeight
Accept KGWeight
If CMHeight Then txt=Ride OK
ELSE
KGWeight45 Then txt=Ride OK
ELSE
Message=No ride
END IF
DISPLAY MESSAGE
END
Flowchart
BEGIN
Accept Height
Accept Weight
IF
HEIGHT
120
THEN MESSAGE=Ride
OK
IF
WEIGHT
45
THEN
MESSAGE=Ride OK
MESSAGE=No
ride
END IF
DISPLAY MESSAGE
END