program casestmt; uses crt; {-------------------------------------------------------------------------- This program will ask for the user's age and then print out a predetermined response depending. This program will do this by use of a case statement. --------------------------------------------------------------------------} VAR age:real; age2:integer; begin clrscr; write ('Hello. How old are you? ---> '); readln (age); writeln; age2 := round(age); case age2 of 0..15 : writeln ('You can''t drive yet!') ; 16..17 : writeln ('You can drive but not vote!') ; 18..20 : writeln ('You can vote but not drink!') ; 21..39 : writeln ('You can do everything and you''re still not over the hill!') ; 40..64 : writeln ('You get nothing but old age!'); 65..110 : writeln ('You get all the senior perks!'); else if age2 > 100 then writeln ('Shouldn't you be dead by now?') else writeln ('INVALID AGE!!!'); end; readln; end.