AMSTRAD CPC464 User Manual page 94

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

Advertisement

Now RUN the program and respond:
W h a t i s y o u r n a m e ? B o b
W H A T I S Y O U R S A L A R Y ? 4 0 0 0 0
ASK FO R B I G G E R C A R
a n d g e t a g o o d a c c o u n t a n t
...a n d l e n d m e a fi v e r B o b
t h a t ' s £1 0 9 . 5 8 9 0 4 1 a d a y
or £110
i f y o u a r e n o t w o rr i e d a b o u t t h e o d d p e
nce
Ready
It' s not very elegant - especially with the break in the word pence. Add...
2 5 P R I N T : P R I N T
8 5 P R I N T
and E D I T 1 0 0 to read:
1 0 0 I N T E G E R . R A T E % = D A I L Y . R A T E : P R I N T
"or £" ; I N T E G E R . R A T E % ; " i f y o u a r e " : P R I N T
" n o t w o r r i e d a b o u t t h e o d d p e n c e "
RUN again, and you will see that the computer has placed i f y o u a r e back on the line above,
since it will now fit (in MODE 1). Add line120 to drive the Ready message further down the screen:
1 2 0 ? : ? : ? : ? : ?
And then r u n the program again; or suppress R e a d y altogether bv typing:
1 2 0 G O T O 1 2 0
Once you run this version, the only way out is to [ESC]ape. Remember that ? is a quick means of
typing PRINT . Now LIST to check the results so far:
10 CLS
1 5 M O D E 1
2 0 I N P U T " W h a t i s y o u r n a m e " ; N A M E $
25 P R I N T : P R I N T
3 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
4 0 I F S A L A R Y < 1 0 0 0 0 T H E N G O T 0 5 0 E L S E 6 0
5 0 P R I N T " A S K F O R A P A Y R I S E " : E N D
6 0 P R I N T " A S K F O R A B I G G E R C A R "
7 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 "
8 0 I F S A L A R Y > 2 5 0 0 0
". . . . a n d l e n d m e a f i v e r " ; N A M E $
8 5 P R I N T
9 0 D A I L Y . R A T E = S A L A R Y / 3 6 5 : P R I N T
" t h a t ' s £ " ; D A I L Y . R A T E ; " a d a y "
1 0 0 I N T E G E R . R A T E % = D A I L Y . R A T E : P R I N T
" o r £ " ; I N T E G E R . R A T E % ; " i f y o u a r e " : P R I N T
n o t w o r r i e d a b o u t t h e o d d p e n c e "
1 1 0 R E M : F O R n = 1 t o 5 0 0 0 : N E X T n : G O T O 10
1 2 0 G O T O 1 2 0
T H E N P R I N T

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents