Quiz for Chapter 6

Let's quiz ! If you haven't read the lesson, you had better do it now before starting.

Time : 60 minutes

1-8 scores 5, 9 scores 10, 10 scores 50

  1. Explain the syntax of procedures and functions.
  2. Explain the differences between them.
  3. Explain the differences between pass by value and pass by reference. Give an example.
  4. Can procedures nest each other ? Explain and give example !
  5. Explain the differences between global variable and local variable.
  6. Explain the rule of calling procedures / functions.
  7. Explain how recursive calls and forward calls works.
  8. Tell me the differences between recursive calls and forward calls.
  9. Make a recursive algorithm of fibonacci series !
  10. Make a guessing number game using functions and procedures. You hold a random number between 1 to 100, and user have to guess. If the guess is smaller than it suppose to be, you should say 'lower'. If the guess is higher, say 'higher'. If it is the same, then user wins. User has 8 chances to guess. If chances are used up, game over. Score is number of chances left times 10. If user wins, get another number and go on. Don't forget to restore the chances back to 8. If game over, ask him/her to play again. Here are some hint :
        function  compare(number, guess : byte):shortint;
        function  advice(comparison : shortint):string;
        function  asknumber: byte;
        function  yesno : boolean;
        function  score(guessleft : byte):longint;
        procedure writeat(x,y : byte; sentence:string);
        procedure setupscreen;
    

That's it ! Good luck !


Where to go ?

Back to chapter 6
Advance to chapter 7, about arrays
To lesson 1 contents
My main tutorial homepage
My programming links
Contact me here

By : Roby Joehanes, © 1996, 2000