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.

A PLURAL NOUN = ?BOXESA VERB = ?HOLDA SINGULAR NOUN = ?WATERTHE BOXES HOLD WATER33 CategorizingA large quantity of numbers can be categorized andthereby cut down into a smaller quantity of numbers. Seeour example: it takes test scores and divides them intoranges labeled A, B, C, D, and F.The program assumes exam or test scores in a rangeof zero to 100. The letter grades include zero to 59, F;60-69, D; 71-79, C; 80-89, B; 90-100, A.Key in as many scores as you like and then enter theletter X to stop the entry cycle.Lines 100-140 sort all scores into the A through Fcategories. Lines 150-170 sort highest and lowest scores.Program Listing10 GOSUB 40020 PRINT •scoRE=n30 INPUT G$40 CLS50 IF G$=•x 0 THEN GOTO 20060 LET G=VAL G$70 LET N=N+l100 IF G59 AND G69 AND G79 AND G89 THEN LET A=A+l150 IF N=l THEN LET L=G155 I~ N=l THEN LET H=G47

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

Saved successfully!

Ooh no, something went wrong!