AMSTRAD CPC464 User Manual page 93

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

Advertisement

10 CLS
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 $
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 $
90 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 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 F O R n = 1 t o 5 0 0 0 : N E X T n : G O T O 1 0
run
All the line numbers have been rounded up - including those referred to within the body of the
program. It wouldn' t be much to you use if BASIC didn' t keep track of all the lines numbers and
update them all simultaneously.
Now we' ll tidy up the display on the screen - and to do this, first disable the loop on line 110, by
turning the line from a command into a REMark:
10 CLS
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 $
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 "
70 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 $
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 not
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 1 0
run
Inserting REM at the beginning of the line causes the remainder to be bypassed by BASIC, which
then ends the program and returns to the Ready prompt – leaving the screen display in view. Now
type in:
15
mode 1
Line 15 will firstly fix the mode of the display so that regardless of what mode was active when you
asked the program to run, line 15 will set it to mode 1. The MODE command automatically performs
a CLS - so line 10 is now redundant, but we' ll leave it there anyway.
T H E N P R I N T
T H E N P R I N T

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents