elif2.ksh

#!/bin/ksh

# elif2.ksh

# This program demontrates the use
# of else at the end of an elif
# statement.

# - Jim

# Let's buy a bus ticket.
# The price may change 
# depending on the age of the
# passenger.

print -n "Enter your age: "
read Age

if (( Age < 5 ));then

 # The cost if free
 TicketCost="Free"

elif (( Age > 54 ));then

 # Senior citizens get
 # 1/2 price.
 TicketCost="\$1"

else

 # Normal price.
 TicketCost="\$2"

fi

print
print "Cost is: $TicketCost"