Quiz for Chapter 3
Now, we'll begin the quiz.
If you haven't got a good grip on
chapter 3, read that chapter first.
Time : 45 minutes.
Number 1 to 5 scores 12 each, number 6 and 7 scores 20 each.
- What does Pascal provide in order to perform conditional branching ?
- Explain briefly each syntax !
- How could we do nested branching ? Is it legal ?
- Tell us how to trap arrow keys !
- How could we trap function keys (F1 through
F10) ? How is it similar to
trapping arrow keys ?
- Determine the output if i=5 and j=3 for the following excerpt :
if i<4 then writeln('Need more experience ...')
else
begin
writeln('Yes, you have it !');
if j<=3 then writeln('But, I would prefer better
ones.')
else writeln('Superb !');
writeln('Congratulations !');
end;
writeln('Thank you for using this program !');
- Make a program to ask ages. Classify the ages into these categories :
Age | Comment |
< 2 | You are a baby ! |
2 <= age < 12 | You are a kid ! |
12 <= age < 18 | You are a teenager ! |
18 <= age < 24 | You are a young adult ! |
24 <= age < 40 | You are an adult ! |
40 <= age < 55 | You are middle aged ! |
55 <= age < 65 | (Give comments yourself) |
age <= 65 | (Give comments yourself) |
That's all folks ! Good luck !
Where to go ?
Back to chapter 3
Advance to chapter 4, about constants
To lesson 1 contents
My main tutorial homepage
My programming links
Contact me
By : Roby Joehanes, © 1996, 2000