NEW
1 REM *** L O V E L A C E . QZ ***
5 PRINT " "
10 PRINT:PRINT "ADA LOVELACE, D A U G H T E R OF THE POET L O R D
B Y R O N , WAS MATHEMATICALLY BRILLIANT. "
20 PRINT
30 PRINT "IN W H A T YEAR DID SHE WRITE HER A M A Z I N G L Y
A C C U R A T E DESCRIPTION OF THE F U T U R E USES OF THE
COMPUTER";
40 TRAP 200
50 INPUT GUESS
6O IF GUESS = 1842 THEN GOTO 100
70 IF GUESS < 1842 THEN GOTO 110
80 IF GUESS > 1842 THEN GOTO 120
100 PRINT: PRINT " C O N G R A T U L A T I O N S ! YOU GUESSED THE Y E A R
C O R R E C T L Y . " : E N D
110 PRINT : PRINT "THAT WAS TOO E A R L Y . TRY A G A I N . " : GOTO 20
120 PRINT:PRINT "THAT WAS TOO LATE. TRY A G A I N . " :GOTO 20
200 PRINT:PRINT "PLEASE ENTER A N U M B E R O N L Y . "
210 GOTO 20
In the Lovelace Quiz, the placement of the PRINT messages
associated with the IF-THEN statements is different from their
placement in the Brainprobe Quiz and the Numbers Quiz. This
difference illustrates that there is often more than one way to
achieve the same results in programming.
Computer Bugs
The TRAP statement makes the Lovelace Quiz more errorproof, but it
still is not perfect. Because the computer evaluates the date as a
number, it will accept 1842.78 as incorrect but 1842,78 as correct.
Most programs have "bugs," or problems. When you can figure out
the bugs and fix them, you have really learned to program. Every
beginner encounters many bugs and makes many mistakes. To
become a better programmer, study this manual, refer to the ATARI
BASIC Reference Guide, and perhaps have a more experienced
person look over your shoulder occasionally. You will learn how to
identify bugs so that you can avoid similar mistakes in future
programs.
FOR-NEXT LOOP: THE COUNTING LOOP
You are already familiar with the infinite GOTO loop. Another kind of
loop is the FOR-NEXT loop. The FOR-NEXT loop is a counting loop,
which is not infinite. Type NEW and enter the following program:
57
Summary of Contents for 65XE
Page 1: ...ATARI 65XE PERSONAL COMPUTER OWNER S MANUAL TM...
Page 3: ...ATARI 65XE PERSONAL COMPUTER TM...
Page 6: ...Part 1 GettingStarted 1...
Page 9: ...4...
Page 23: ...18...
Page 25: ...20...
Page 32: ...Part 2 Programming withATARI BASIC 27...
Page 33: ...28...
Page 59: ...54...
Page 69: ...64...
Page 82: ...Part3 Appendices 77...
Page 83: ...78...
Page 97: ...92...
Page 105: ...100...
Page 125: ...120...
Page 126: ...121 Index...
Page 127: ...122...
Page 134: ...ATARI 1987 Atari Corp All Rights Reserved Printed in Taiwan C072018 001 REV B K l 2 1987...
Page 135: ......