12.07.2015 Views

page-1983-101-timex-sinclair-programming-tricks

page-1983-101-timex-sinclair-programming-tricks

page-1983-101-timex-sinclair-programming-tricks

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

30 PRINT A$;40 GOTO 1036 Question & AnswerHere's how to use the DATA statement, and the computer'sability to.search for data, to create a Q&A.How many days are there in a month? It's a toughquestion for grade schoolers and some extra study may bein order. Use this program.The program has the computer present the numberofa monthandthen askhow manydays are in that particularmonth.If you enter a correct answer, the computer will say so.If you enter an incorrect answer, the computer will sayyour anwer was wrong and tell the correct answer.The program runs on forever until you press theBREAK key,Program Listing10 DIM 0(12)20 RAND100 LET D(l)=31110 LET D(2)=28120 LET D(3)=31130 LET D(4)=30140 LET D(5)=31150 LET D(6)=30160 LET D(7)=31170 LET D(8)=31180 LET D(9)=30190 LET 0(10)=31200 LET 0(11)=30210 LET 0(12)=31300 LET R=INT(l3*RND}310 IF R

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!