EasyManuals Logo

Sinclair QL Beginner's Guide

Sinclair QL
135 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #45 background imageLoading...
Page #45 background image
8. Some programs use more memory in defining procedures, but in what circumstances do
procedures save memory space?
9. Name two ways by which information can be passed from main program to a procedure. (two
points)
10. What is an actual parameter?
11. What is a formal parameter?
PROBLEMS ON CHAPTER 7
1. Write a procedure which outputs one of the four suits: 'Hearts', 'Clubs: 'Diamonds' or 'Spades'.
Call the procedure five times to get five random suits.
2. Write another program for problem 1 using a number in the range 1 to 4 as a parameter to
determine the output word. If you have already done this, then try writing the program without
parameters.
3. Write a procedure which will output the value of a card that is a number in the range 2 to 10 or
one of the words 'Ace', 'Jack' 'Queen', 'King'.
4. Write a program which calls this procedure five times so that five random values are output.
5. Write the program of problem 3 again using a number in the range 1 to 13 as a parameter to be
passed to the procedure. If this was the method you used first time, then try writing the program
without parameters.
6. Write the most elegant program you can, using procedures, to output four hands of five cards
each. Do not worry about duplicate cards. You can take elegance to mean an appropriate mixture
of readability shortness and efficiency. Different people and/or different circumstances will place
different importance on these three qualities which sometimes work against each other.

Other manuals for Sinclair QL

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Sinclair QL and is the answer not in the manual?

Sinclair QL Specifications

General IconGeneral
ProcessorMotorola 68008
Clock Speed7.5 MHz
RAM128 KB (expandable to 640 KB)
ROM48 KB
Operating SystemSinclair QDOS
Release Year1984
StorageMicrodrive tape loop
Graphics256x256 pixels, 8 colors
PortsRS-232, ROM cartridge
SoundBeeper (internal speaker)

Related product manuals