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.

38 Gee Whiz II:Three-Digit MysteryHave your neighbor secretly select any three-digitnumber in which all three digits are the same. Then havehim tell the computer only the sum of those three digits.The computer will identify his secret number!Program Listing10 CLS20 PRINT •sELECT A THREE-DIGIT NUMBER 030 PRINT •wITH ALL THREE DIGITS THESAME 040 PRINT50 PRINT •ADD THE THREE DIGITS TOGETHER"60 PRINT •WHAT IS THE SUM 065 PRINT •oF THE THREE DIGITS ?n70 INPUT N75 CLS80 LET Q=37*N90 PRINT100 PRINT •yoUR ORIGINAL NUMBER WAS •;Q110 PRINT120 PRINT130 GOTO 2039 Gee Whiz Ill: Yes/NoDecision MakerThis is handy for the busy executive who doesn'thave time for decisions.Line 10 clears the screen. Line 20 generates a randomnumber from zero to 99. Line 30 selects a yesanswer if the random number is greater than 49. Otherwise,line 40 chooses a no answer.56

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

Saved successfully!

Ooh no, something went wrong!