Basic Program To Plots a Histogram

REM THIS IS A PROJECT NOT IN COURSE
10 REM this program plots a histogram
20 REM the y-axis is horizontal and x-axis vertical
30 FOR I = 0 TO 40 STEP 10
40 PRINT TAB(I + 11); I;
48 NEXT I
50 PRINT TAB(11); “——————————————————”
60 PRINT
70 FOR I = 1 TO 4
80 READ N$, P
90 LET R = INT(P + .5)
100 FOR J = 1 TO 5
110 IF (J <> 3) THEN 130
120 PRINT TAB(4); N$;
130 FOR K = 1 TO R
140 PRINT TAB(10 + K); “*”;
150 NEXT K
160 PRINT
170 NEXT J
180 NEXT I
190 PRINT TAB(11); “—————————————————–”
200 PRINT
210 DATA “1951”,18.7,”1961″,22.4,”1971″,28.2,”1981″,35.6
220 END

Please follow and like us:

Leave a comment