AMSTRAD CPC464 User Manual page 88

Cpc464 colour personal computer 64k
Hide thumbs Also See for CPC464:
Table of Contents

Advertisement

Here comes a brief program to demonstrate these operators, based on subject very dear to our
hearts. If you are not already looking at the switch on screen message:
A m s t r a d 6 4 k M i c r o c o mp u t e r ( v 1 )
c 1 9 8 4 A m s t r a d C o n s u m e r E l e c t r o n i c s
a n d L o c o m o t i v e S o f t w a r e L t d .
B A S I C 1 . 0
Ready
. . ..then press the [CTRL] [SHIFT] and [ESC] keys, holding them down simultaneously, and the
computer will reset to the above message. Now proceed and type in the following (editing
instructions are given in 1.2.7):
1 0 I N P U T " W H A T I S Y O U R S A L A R Y " ; S A L A R Y
2 0 I F S A L A R Y < 1 0 0 0 0 T H E N G O T 0 3 0 E L S E 4 0
3 0 P R I N T " A S K F O R A P A Y R I S E " : E N D
4 0 P R I N T " A S K F O R A B I G G E R C A R "
Run this small program by typing:
RUN
and the obligatory [ENTER]. The computer asks you a question:
W H A T I S Y O U R S A L A R Y ?
(Note how the computer automatically adds the question mark when it wants you to respond with
an input of data). Answer the question using only numbers – not letters, currency signs or commas,
and enter your answer with the [ENTER] key.
Add line 5 below by simply typing after the end of the above operation, when the Ready prompt
reappears:
5 CLS
RUN again to wipe the screen. If your first answer was less than 10000, make this reply more than
10000, and you will see the difference. Now extend the original program by adding line 50 below:
5 CLS
1 0 I N P U T " W H A T I S Y O U R S A L A R Y " ; S A L A R Y
2 0 I F S A L A R Y < 1 0 0 0 0 T H E N G O T 0 3 0 E L S E 4 0
3 0 P R I N T " A S K F O R A P A Y R I S E " : E N D
4 0 P R I N T " A S K F O R A B I G G E R CAR"
5 0 I F S A L A R Y > 3 0 0 0 0 T H E N P R I N T " a n d
g e t a g o o d a c c o u n t a n t "
run
The END at line 30 stops the program and returns to the prompt. Since there' s no end on line 40, the
program proceeds to see if the SALARY variable is greater than 30000 - in which case the program
responds with yet more sound advice!

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents