You are on page 1of 2

THE SELECTION / CONDITIONAL STATEMENT

Tutorial 1: Write a program to output the price of a ticket according to age groups. 1=<age<6, price = free 6=<age<20 , price = RM 5 20=<age<34 , price = RM10 age>=34 , price = RM15 Below are the sample outputs:

Tutorial 2: Write a program to calculate the area and perimeter of a rectangle. User can choose either to calculate area or perimeter. area = width x height perimeter = width + width + height + height Below are the sample outputs: