Now RUN the program and respond:
What is your name? Bob
WHAT IS YOUR SALARY? 40000
ASK FOR BIGGER CAR
and get a good accountant
…and lend me a fiver Bob
that's £109.589041 a day
or £110
if you are not worried about the odd pe
nce
Ready
It’s not very elegant - especially with the break in the word pence. Add...
25 PRINT: PRINT
85 PRINT
and EDIT 100 to read:
100 INTEGER.RATE%=DAILY.RATE: PRINT
"or £”; INTEGER.RATE%;" if you are ":PRINT
"not worried about the odd pence"
RUN again, and you will see that the computer has placed if you are back on the line above,
since it will now fit (in MODE 1). Add line120 to drive the Ready message further down the screen:
120 ?:?:?:?:?
And then run the program again; or suppress Ready altogether bv typing:
120 GOTO 120
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
15 MODE 1
20 INPUT "What is your name";NAME$
25 PRINT:PRINT
30 INPUT "WHAT IS YOUR SALARY";SALARY
40 IF SALARY < 10000 THEN GOT0 50 ELSE 60
50 PRINT "ASK FOR A PAY RISE": END
60 PRINT "ASK FOR A BIGGER CAR"
70 IF SALARY >30000 THEN PRINT
"and get a good accountant"
80 IF SALARY >25000 THEN PRINT
“. . . . and lend me a fiver ";NAME$
85 PRINT
90 DAILY.RATE=SALARY/365:PRINT
"that's £“;DAILY.RATE;" a day"
100 INTEGER.RATE%=DAILY.RATE:PRINT
"or £“;INTEGER.RATE%;" if you are “:PRINT
not worried about the odd pence”
110 REM:FOR n=1 to 5000: NEXT n:GOTO 10
120 GOTO 120