8-Bit Software Online Conversion
Area Calculator - Listing
10*FX200,3
20ON ERROR RUN
30MODE1:PROCINIT
40DEF PROCINIT
50VDU23;8202;0;0;0;
60VDU23,241,24,24,0,255,0,0,24,24
70VDU23,240,96,32,64,96,0,0,0,0
80VDU23,242,8,20,34,8,20,34,0,0
90VDU23,243,0,16,40,68,130,0,0,0
100VDU23,244,0,0,0,0,130,68,40,16
110VDU23,245,0,255,36,36,36,36,36,36,0
120PRINT''
130COLOUR1
140PRINT" *÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷
÷÷÷÷÷÷÷÷÷*"
150PRINT" *";:COLOUR7:PRINT" AREA CAL
CULATOR by David Stillman ";:COLOUR1:PRI
NT"*"
160PRINT" *÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷
÷÷÷÷÷÷÷÷÷*"
170PRINT''
180COLOUR2
190PRINT"1. Area of Rectangle"
200PRINT
210PRINT"2. Area of Circle"
220PRINT
230PRINT"3. Area of 90' Triangle"
240PRINT
250PRINT"4. Area of Parallelogram"
260PRINT
270PRINT"5. Area of Rhombus"
280PRINT
290PRINT"6. Area of Trapezium"
300PRINT
310PRINT"7. Area of Triangle"
320COLOUR7
330PRINT''"Enter the number: "
340COLOUR2
350A$=GET$
360SOUND1,-15,150,1
370IF A$="1" THEN PROCRECTANGLE
380IF A$="2" THEN PROCCIRCLE
390IF A$="3" THEN PROC90TRIANGLE
400IF A$="4" THEN PROCPARALLELOGRAM
410IF A$="5" THEN PROCRHOMBUS
420IF A$="6" THEN PROCTRAPEZIUM
430IF A$="7" THEN PROCTRIANGLE
440GOTO350
450PROCRECTANGLE
460DEF PROCRECTANGLE
470CLS
480PRINTTAB(20,20);"b"
490PRINTTAB(10,10);"a"
500MOVE1000,1000
510DRAW400,1000
520DRAW400,400
530DRAW1000,400
540DRAW1000,1000
550C=0
560INPUTTAB(0,22)"Enter a: "A
570INPUTTAB(0,23)"Enter b: "B
580C=A*B
590PRINTTAB(0,24)"Area = ";A;" x ";B
600REPEAT UNTIL GET=32
610CLS
620PRINTTAB(20,20);INTB
630PRINTTAB(10,10);INTA
640MOVE1000,1000
650DRAW400,1000
660DRAW400,400
670DRAW1000,400
680DRAW1000,1000
690PRINTTAB(10,24)"Area = ";C;" units"
;CHR$240
700REPEAT UNTIL GET=32
710RUN
720ENDPROC
730REM *** 90' TRIANGLE ***
740DEF PROC90TRIANGLE
750CLS
760MOVE800,0
770PLOT85,800,800
780PRINTTAB(25,20)"h"
790PRINTTAB(13,31)"a"
800PRINTTAB(0,0)
810INPUT"Enter a: "a
820INPUT"Enter h: "h
830C=0:C=a/2*h
840PRINT'"Area = ";a;" ";CHR$241;" 2 x
";h
850REPEAT UNTIL GET=32
860CLS
870MOVE0,0
880MOVE800,0
890PLOT85,800,800
900PRINTTAB(25,20);INTh
910PRINTTAB(13,31);INTa
920PRINTTAB(0,0)
930PRINT'"Area = ";C;" units";CHR$240
940REPEAT UNTIL GET=32:RUN
950ENDPROC
960REM *** PARALLELOGRAM ***
970DEF PROCPARALLELOGRAM
980CLS
990MOVE100,1000
1000DRAW600,1000
1010DRAW900,500
1020DRAW400,500
1030DRAW100,1000
1040MOVE50,970:DRAW50,500
1050PRINTTAB(0,0)
1060PRINTTAB(12,0)">"
1070PRINTTAB(20,16)">"
1080PRINTTAB(7,8);CHR$242
1090PRINTTAB(23,8);CHR$242
1100PRINTTAB(1,1);CHR$243
1110PRINTTAB(1,16);CHR$244
1120PRINTTAB(2,8)"h"
1130PRINTTAB(20,17)"a"
1140INPUTTAB(0,18)"Enter h: "H
1150INPUTTAB(0,19)"Enter a: "A
1160PRINTTAB(0,21)"Area = a x h"
1170REPEAT UNTIL GET=32
1180CLS
1190MOVE100,1000
1200DRAW600,1000
1210DRAW900,500
1220DRAW400,500
1230DRAW100,1000
1240PRINTTAB(0,0)
1250PRINTTAB(12,0)">"
1260PRINTTAB(20,16)">"
1270PRINTTAB(7,8);CHR$242
1280PRINTTAB(23,8);CHR$242
1290PRINTTAB(2,8);INTH
1300PRINTTAB(20,17);INTA
1310PRINTTAB(0,21)"Area = ";A*H;" units
";CHR$240
1320REPEAT UNTIL GET=32:RUN
1330ENDPROC
1340REM *** CIRCLE ***
1350DEF PROCCIRCLE
1360CLS
1370MOVE500,500
1380B=0
1390FOR B=-300 TO 300 STEP10
1400A=SQR(90000-B^2)
1410DRAW500+A,500+B
1420NEXTB
1430FOR B=-300 TO 300 STEP10
1440A=SQR(90000-B^2)
1450DRAW500-A,500-B
1460NEXTB
1470PRINTTAB(0,0)
1480PRINTTAB(14,20)"r"
1490PRINTTAB(0,26)"Area = ";CHR$245;"r"
;CHR$240
1500INPUTTAB(0,5)"Enter r: "R
1510REPEAT UNTIL GET=32
1520CLS
1530MOVE500,500
1540B=0
1550FOR B=-300 TO 300 STEP10
1560A=SQR(90000-B^2)
1570DRAW500+A,500+B
1580NEXTB
1590FOR B=-300 TO 300 STEP10
1600A=SQR(90000-B^2)
1610DRAW500-A,500-B
1620NEXTB
1630A=PI*R^2
1640PRINTTAB(0,0)
1650PRINTTAB(13,15);INTA
1660PRINTTAB(0,27)"Area = ";A;" units";
CHR$240
1670REPEAT UNTIL GET=32:RUN
1680ENDPROC
1690REM *** RHOMBUS
1700DEF PROCRHOMBUS
1710CLS
1720MOVE600,1000
1730DRAW1100,600
1740DRAW600,200
1750DRAW100,600
1760DRAW600,200
1770DRAW600,1000
1780DRAW100,600
1790DRAW1100,600
1800PRINTTAB(0,0)
1810PRINTTAB(13,12)"A"
1820PRINTTAB(19,10)"B"
1830INPUTTAB(0,25)"Enter A: "A
1840INPUTTAB(0,26)"Enter B: "B
1850PRINTTAB(0,28)"Area = A ";CHR$241;"
2 x B"
1860REPEAT UNTIL GET=32
1870CLS
1880MOVE600,1000
1890DRAW1100,600
1900DRAW600,200
1910DRAW100,600
1920DRAW600,200
1930DRAW600,1000
1940DRAW100,600
1950DRAW1100,600
1960PRINTTAB(0,0)
1970PRINTTAB(13,12);A
1980PRINTTAB(19,10);B
1990C=INTA/2*INTB
2000PRINTTAB(0,28)"Area = ";C;" units";
CHR$240
2010REPEAT UNTIL GET=32:RUN
2020ENDPROC
2030REM *** TRAPEZIUM ***
2040DEF PROCTRAPEZIUM
2050CLS
2060MOVE300,900
2070DRAW800,900
2080DRAW1100,500
2090DRAW0,500
2100DRAW300,900
2110MOVE1120,900
2120DRAW1120,500
2130PRINTTAB(0,0)
2140PRINTTAB(17,3)"A"
2150PRINTTAB(17,16)"B"
2160PRINTTAB(36,8)"H"
2170INPUT TAB(0,17)"Enter A: "A
2180INPUTTAB(0,18)"Enter B: "B
2190INPUTTAB(0,19)"Enter H: "H
2200PRINTTAB(0,21)"Area = A + B ";CHR$2
41;" 2 x H"
2210REPEAT UNTIL GET=32
2220CLS
2230MOVE300,900
2240DRAW800,900
2250DRAW1100,500
2260DRAW0,500
2270DRAW300,900
2280MOVE1120,900
2290DRAW1120,500
2300PRINTTAB(0,0)
2310PRINTTAB(17,3);INTA
2320PRINTTAB(17,16);INTB
2330PRINTTAB(36,8);INTH
2340C=0.5*(A+B)*H
2350PRINTTAB(0,19)"Area = ";C;" units";
CHR$240
2360REPEAT UNTIL GET=32:RUN
2370ENDPROC
2380REM *** TRIANGLE ***
2390DEF PROCTRIANGLE
2400CLS
2410MOVE500,600
2420DRAW0,100
2430DRAW1000,100
2440DRAW500,600
2450PRINTTAB(0,0)
2460PRINTTAB(5,20)"A"
2470PRINTTAB(25,20)"B"
2480PRINTTAB(15,29)"C"
2490INPUTTAB(0,5)"Enter A: "A
2500INPUTTAB(0,6)"Enter B: "B
2510INPUTTAB(0,7)"Enter C: "C
2520PRINTTAB(0,8)"Area = A + B + C ";CH
R$241;" 2"
2530REPEAT UNTIL GET=32
2540CLS
2550MOVE500,600
2560DRAW0,100
2570DRAW1000,100
2580DRAW500,600
2590PRINTTAB(0,0)
2600PRINTTAB(5,20);INTA
2610PRINTTAB(25,20);B
2620PRINTTAB(15,29);C
2630D=0.5*(A+B+C)
2640PRINTTAB(0,8)"Area = ";D;" units";C
HR$240
2650REPEAT UNTIL GET=32:RUN
2660ENDPROC