•
•
You
can score a maximum
of
14
points
from
the
following
test.
Check your score
with
the answers on page
108.
1.
Why
are lower case
letters
preferred
for
program words which
you
choose?
2.
What
IS
the purpose
of
indenting?
3.
What should normally guide your choice
of
identifiers
for
variables and
loops?
4.
Name three
ways
of
editing a program
in
the
computer's main memory (three
points).
5.
What should
you
remember
to
type
at
the end
of
every
command
or
program
line
when
you
enter
it?
6.
What should
you
normally type before
you
enter a program
at
the
keyboard?
7.
What must be
at
the
beginning
of
every
line
to
be stored
as
part
of
a program?
8.
What must
you
remember
to
type
to
make a program
execute?
9.
What keyword enables
you
to
put
into
a program information which
has
no
effect
on the execution?
10.
Which two keywords help
you
to
store
programs
on
and
retrieve
from
cartridges?
(two
pOints).
SELF
TEST
ON
CHAPTER
5
1.
Re-write
the
following program using
lower
case
letters
to
give
a
better
presentation.
Add the words NEW and RUN. Use
line
numbers and
the
ENTER symbol
Just
as
you
would
to
enter
and
run
a program. Use REMark
to
give
the program a
name.
PROBLEMS
ON
CHAPTER
5
2
•
LET
TWO$
=
"TWO"
LET
FOUR$ =
"FOUR"
LET
SIX$
=
TWO$
& FOUR$
PRINT
LEN(six$)
Explain how two and four can produce
7.
Use indenting, lower
case
letters,
NEW, RUN, line numbers and
the
ENTER
symbol
to
show how
you
would actually enter and
run
the following program:
REPEAT
LOOP
LETTER
CODE
=
RND
(65
TO
90)
LET
LETTERS$
=
CHR$(LETTER
CODE)
PRINT
LETTER$
IF
LETTER$
=
'z'
THEN
EXIT
LOOP
END
REPEAT
LOOP
3.
Re-write
the following program
in
better
style
using meaningful variable names
and good presentation.
Write
the program
as
you
would enter
it:
LET S =0
REPeat
TOTAL
LET
N = RND(1
TO
6)
PR
I NT I N I
LET
S =S + N
IF
n =6 THEN
EXIT
TOTAL
END
REPeat
TOTAL
PRINT
S
Decide what
the
program does and then enter and
run
it
to
check your decision.
12/84