Download Print this page

Commodore 64 User Manual page 48

Hide thumbs Also See for COMMODORE 64:

Advertisement

£KEY
The £ symbol stands for the British pound ster
ling. To make the pound sign appear, press the
key by itself. Use this symbol now in the fol
lowing command:
?"£2 FOR KIDNEY PIE"
Now press RETURN.
SCREEN 1
%/5 KEY
To make the % character appear, you hold
down the SHIFT key while pressing the num
ber 5 key.
The percent sign is also the abbreviation for a
term in BASIC. It identifies a box in memory as
a special type of number called an integer. This
means that the number cannot be written as a
fraction or a decimal, but can be worth less
than zero fa positive or negative number that
cannot be split into smaller parts). When you
use the % sign to stand for an integer, the
computer always takes a decimal number and
rounds it down [truncates it) when it is con
verted to an integer (a whole number),
plus or minus sign in front of it).
Try this now by typing the following:
= 3.14
Now press RETURN.
SCREEN 2
Now type the following to ask the computer
to round down the decimal number.
Now press RETURN for your answer. The
computer rounds down the number to 3.
SCREEN 3
Before going on to the next exercise, clear
the screen by holding down a SHIFT key and
pressing the CLR/HOME key.
PERCENT/5 key • £ key
46
?»HflfIBURC'ERS
COST
s:
HAMBURGERS
COST
12
REfiDV.
:■?■•■ JLZZ
FOR
KIDNEV
PIE1
?JE2
FOR
KIDNEV
PIE
READV.
:
SCREEN 1
The £ sign Is used to Indicate the British
pound sterling.
HMllEUI
6
HftMEURGER
reacv .
.?"£a
FOR
Kir-NEV
PIE
U.2
FOR
KIDNEV
PIE
SCREEN 2
Used In this equation, the % sign stands for
Integer.
1URGERS
CO3T
BUftGERS
COST
*
FOR
KIBNEV
PIE
OR
KIDNEV
PIE
SCREEN 3
When the answer is printed. It is rounded
down to an Integer number.

Advertisement

loading

Related Products for Commodore COMMODORE 64

This manual is also suitable for:

Vic 20