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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

100 FOR Y=l5 TO 25 STEP <strong>101</strong>10 FOR X=l5 TO 37120 PLOT X,Y130 NEXT X140 NEXT Y200 FOR X=l5 TO 37 STEP 22210 FOR Y=l5 TO 25220 PLOT X,Y230 NEXT Y240 NEXT X300 PRINT AT 11,ll;"TITLE"310 GOTO 3<strong>101</strong>00 Draw Bar GraphsDrawing graphs on the video screen are a popularform of communication today. This program establishes abar graph on the TIMEX display.We have selected the business-like example, shownhere, to demonstrate how you go about setting up a bargraph on the TV screen.Lines 10 to 80 are used to input data needed to begraphed. We have selected annual profits as the subjectfor our graph.Line 10 asks for total profits in the year 1979; line 40for 1980; etc. For the purposes of our graph, the maximumvalue you can enter will be 26. When the computer asksfor the annual-profits data, give it numbers from 1 to 216.Line 110 prints the heading.Lines 200 to 240 create the first-year bar on the graph.Lines 300 to 340 create the second-year bar, and so onthrough line 440 which concludes the last-year bar on thegraph.Program Listing10 PRINT "1979 PROFITS"20 INPUT A30 CLS40 PRINT "1980 PROFITS"115

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

Saved successfully!

Ooh no, something went wrong!