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.

  1. What does Pascal provide in order to perform conditional branching ?
  2. Explain briefly each syntax !
  3. How could we do nested branching ? Is it legal ?
  4. Tell us how to trap arrow keys !
  5. How could we trap function keys (F1 through F10) ? How is it similar to trapping arrow keys ?
  6. 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 !');
  7. Make a program to ask ages. Classify the ages into these categories :
    AgeComment
    < 2You are a baby !
    2 <= age < 12You are a kid !
    12 <= age < 18You are a teenager !
    18 <= age < 24You are a young adult !
    24 <= age < 40You are an adult !
    40 <= age < 55You 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