Algortihm (Amusment Park)

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Question: An amusement- park ride requires that the rider be at least

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

You might also like