program fly1; uses crt; {-------------------------------------------------------------------------- This program will compute the price the user must pay for an airline ticket to a place a given number of miles away. There are discounts for age. by --------------------------------------------------------------------------} VAR age,miles:integer; price1,price2,dis:real; begin clrscr; writeln; writeln; textcolor(green); writeln ('Children 12 and under: 50% off'); writeln ('Teens age 13 to 17: 25% off'); writeln ('Adults: Full Fare $0.15 per mile'); writeln ('Seniors 55 and over: 30% off'); writeln; writeln; write ('Hello. How old are you? ---> '); readln(age); writeln; write ('How far do you want to fly (in miles)? ---> '); readln(miles); case age of 0..12 : dis := 0.50; 13..17 : dis := 0.25; 18..54 : dis := 0; 55..135 : dis := 0.30; end; price1 := miles * 0.15 ; writeln; writeln; textcolor(red); writeln ('Price before the discount: $',price1:0:2); price2 := price1 * dis; dis := dis * 100; writeln; writeln ('Your discount of ',dis:0:0,'%: $',price2:0:2); price1 := price1 - price2; writeln; writeln ('Your final price: $',price1:0:2); readln; end.