1REM SAVE"Percentage"
2REM Save on EDUCATION Disc
3REM Save under $.MATHS
4REM PUBLIC DOMAIN
10 REM PERCENT
20 REM (c) D.J. Aldous, with assistan
ce from Stuart Keeley, November 1986.
30 MODE4
40 PROC`LOGO
50 MODE7
60 VDU12,23;8202;0;0;0;
70 I=INKEY(50)
80 PRINTTAB(10,11);CHR$131;CHR$141;"P
E R C E N T":PRINTTAB(10,12);CHR$131;CH
R$141;"P E R C E N T"
90PRINTTAB(10,14);CHR$134;"by D.J. A
ldous"
100 I=INKEY(400)
110 CLS
120 PRINT
130 PROC`CENTRE("%",131)
140 PRINT';
150 PRINT"This program is designed for
those who wish to learn about percenta
ges and who wish to make percentage calc
ulations."
160 PRINT'"Examples are given of each
of the three different basic percentage
calculations."
170 PRINT'CHR$(130);" Different types
of calculation are"
180 PRINTCHR$(130);" colour-coded";CH
R$(135);"WHITE,";CHR$(131);"YELLOW";CHR$
(130);"or";CHR$(134);"BLUE"
190 PRINT'
200 PROC`CENTRE("Results appear in RED
",129)
210 PROC`CONTINUE
220 CLS
230 PRINT'
240 PROC`CENTRE("The program covers th
e following :",130)
250 PRINT''" S Simple Percentages"
260PRINTCHR$(131);"C Percentage Chang
e"
270PRINTCHR$(134);"P Profit and Marku
p (or 'Margin')"
280 PRINT'';
290 PROC`CENTRE("Which type of calcula
tion do you want?",130)
300PRINT'
310 VDU23;29194;0;0;0;
320REPEAT
330 PRINTCHR$(130);" Enter"CHR$
(135);"S";CHR$(130);"or";CHR$(131);"C";C
HR$(130);"or";CHR$(134);"P"
340 ch$=GET$
350UNTIL ch$="S" OR ch$="C" OR ch$="P"
OR ch$="s" OR ch$="c" OR ch$="p" : CLS
360IF ch$="S" OR ch$="s" THEN PROC`S E
LSE IF ch$="C" OR ch$="c" THEN PROC`C EL
SE PROC`P
370
380 END
390
400DEFPROC`S
410 VDU12,23;8202;0;0;0;
420 PROC`S`HEAD
430 PROC`S`EX
440 PROC`CONTINUE
450 PROC`S`HEAD
460 VDU23;29194;0;0;0;
470 PRINT'
480 PROC`CENTRE("Which one do you want
to calculate ?",130)
490PRINT'
500 REPEAT
510 PROC`CENTRE("Enter A, B or P",130)
520 CHOICE$=GET$
530UNTIL CHOICE$="A" OR CHOICE$="B" OR
CHOICE$="P" OR CHOICE$="a" OR CHOICE$="
b" OR CHOICE$="p" : CLS : PROC`S`HEAD
540IF CHOICE$="A" OR CHOICE$="a" THEN
PROC`S`ONE ELSE IF CHOICE$="B" OR CHOICE
$="b" THEN PROC`S`TWO ELSE PROC`S`THREE
550PROC`AGAIN
560ENDPROC
570
580
590DEFPROC`S`HEAD
600 PRINT';
610 PROC`CENTRE(" SIMPLE PERCENTAGE",1
35)
620 PROC`CENTRE(" `````` ``````````",1
35)
630PRINT'
640PRINT"A First Number (Base Numbe
r)"
650PRINT"B Second Number"
660PRINT"P Percentage that B is of
A"
670ENDPROC
680
690DEFPROC`S`EX
700 PRINT'
710 PROC`CENTRE("Example 1 :",135)
720PRINT"The price of a tin of smoked
oysters is 60p (A). VAT of 9p (B) is add
ed. What is the percentage rate of VAT
(P)?"
730 PRINT'" P = B/A * 100
%"
740PRINT" = 9/60 * 100 %
"
750PRINT" = 15 %"
760PRINT'
770PRINT"This formula may also be used
to find A or B."
780ENDPROC
790
800DEFPROC`C
810 VDU12,23;8202;0;0;0;
820PROC`C`HEAD
830PROC`C`EX
840PROC`CONTINUE
850PROC`C`HEAD
860 VDU23;29194;0;0;0;
870PRINT'
880 PROC`CENTRE("Which one do you want
to calculate ?",130)
890 PRINT'
900 REPEAT
910 PROC`CENTRE("Enter O or N or C",13
0)
920 SELECT$=GET$
930UNTIL SELECT$="O" OR SELECT$="N" OR
SELECT$="C" OR SELECT$="o" OR SELECT$="
n" OR SELECT$="c" : CLS : PROC`C`HEAD
940IF SELECT$="O" OR SELECT$="o" THEN
PROC`C`ONE ELSE IF SELECT$="N" OR SELECT
$="n" THEN PROC`C`TWO ELSE PROC`C`THREE
950PROC`AGAIN
960ENDPROC
970
980DEFPROC`C`HEAD
990 PRINT';
1000 PROC`CENTRE("PERCENTAGE CHANGE",13
1)
1010 PROC`CENTRE("`````````` ``````",13
1)
1020PRINT';
1030 PRINTCHR$(131);"O Original Value"
1040 PRINTCHR$(131);"N New Value"
1050PRINTCHR$(131);"C Percentage Chang
e"
1060ENDPROC
1070
1080DEFPROC`C`EX
1090PRINT'
1100 PROC`CENTRE("Example 2 :",135)
1110PRINT"During 1980 the US dollar was
worth 43p";CHR$(131);"(O).";CHR$(13
5);"In early 1985 it was worth 96p"C
HR$(131);"(N)."
1120 PRINT"What is the";CHR$(131);"Perc
entage Change";CHR$(131);"(C)";CHR$(135)
;"?"
1130PRINT'" ";CHR$131;"C";CHR$
135;"= 100*(N-O)/O"
1140PRINT" = 100*(96-43)/43
"
1150PRINT" = 123.3%"
1160PRINT'
1170PRINT"This formula may also be used
to find ";CHR$(131);"O";CHR$(135);"or
";CHR$(131);"N."
1180ENDPROC
1190
1200
1210DEFPROC`P
1220 VDU12,23;8202;0;0;0;
1230PROC`P`HEAD
1240PROC`P`EX
1250 PROC`CONTINUE
1260 PROC`P`HEAD
1270 PROCpmnote
1280PROC`CONTINUE
1290PROC`P`HEAD
1300 VDU23;29194;0;0;0;
1310PRINT'
1320 PROC`CENTRE("Which one do you want
to calculate ?",130)
1330PRINT'
1340REPEAT
1350 PROC`CENTRE("Enter P or M",130)
1360 select$=GET$
1370 UNTIL select$="P" OR select$="M" O
R select$="p" OR select$="m" : CLS : PRO
C`P`HEAD
1380IF select$="P" OR select$="p" THEN
PROC`P`ONE ELSE PROC`P`TWO
1390PROC`AGAIN
1400ENDPROC
1410
1420DEFPROC`P`HEAD
1430 PRINT';
1440 PROC`CENTRE("PROFIT AND MARKUP",13
4)
1450 PROC`CENTRE("`````` ``` ``````",13
4)
1470 PRINTTAB(3,4);CHR$(134);"The relat
ionship between -"
1480PRINTCHR$(134);"P Gross Profit
and"
1490PRINTCHR$(134);"M Markup, or 'Marg
in'"
1500ENDPROC
1510
1520DEFPROC`P`EX
1530 PRINT';
1540 PROC`CENTRE("Example 3 :",135)
1550PRINT"A man buys a car and then sel
ls it. If he makes a";CHR$(134);"profit
(P)";CHR$(135);"of 20% (the sale price
less the cost price, as a perce
ntage of the";CHR$(134);"SALE";CHR$(135)
;"price), what was"
1560PRINT"his percentage Markup ?
(";CHR$(134);"Markup (M)";CHR
$(135);"is the sale price less the cost
price as a percentage of the";CHR$(134);
"COST";" price)."
1570PRINT" ";CHR$134;"M";CHR$135;
"= (100*P)/(100-P)"
1580PRINT" = (100*20)/(100-20)
"
1590PRINT" = 25%"
1600 PRINT';
1610PRINT"This formula may also be used
to find";CHR$134;"P."
1620 ENDPROC
1630
1640 DEFPROC`S`ONE
1650 PRINT'
1660 REPEAT
1670 PRINTCHR$(130)"Enter B ";CHR$(13
5);:INPUT B;
1680 UNTIL B>0
1690 PRINT';
1700 REPEAT
1710 PRINTCHR$(130)"Enter P ";CHR$(1
35);:INPUT P;
1720 UNTIL P>0
1730 A=(B*100)/P
1740 PRINT'
1750 PRINT"First Number = ";CHR$(129);A
1760 PROC`AGAIN
1770 ENDPROC
1780
1790 DEFPROC`S`TWO
1800PRINT'
1810 REPEAT
1820 PRINTCHR$(130)"Enter A ";CHR$(13
5);:INPUT A;
1830 UNTIL A>0
1840 PRINT';
1850 REPEAT
1860 PRINTCHR$(130)"Enter P ";CHR$(1
35);:INPUT P;
1870 UNTIL P>0
1880B=(A*P)/100
1890 PRINT'
1900PRINT"Second Number = ";CHR$(129);B
1910 PROC`AGAIN
1920 ENDPROC
1930
1940 DEFPROC`S`THREE
1950PRINT'
1960 REPEAT
1970 PRINTCHR$(130)"Enter A ";CHR$(13
5);:INPUT A;
1980 UNTIL A>0
1990 PRINT';
2000 REPEAT
2010 PRINTCHR$(130)"Enter B ";CHR$(13
5);:INPUT B;
2020 UNTIL B>0
2030P=(B/A)*100
2040 PRINT'
2050PRINT"B is";CHR$(129);P;CHR$(135);"
% of A"
2060PROC`AGAIN
2070 ENDPROC
2080
2090 DEFPROC`C`ONE
2100 LOCAL c%
2110PRINT'
2120 REPEAT
2130 PRINTCHR$(130)"Enter N ";CHR$(13
5);:INPUT N;
2140 UNTIL N>0
2150 PRINT';
2160 REPEAT
2170 PRINTCHR$(130)"Enter C ";CHR$(13
5);:INPUT C$;
2180 c%=ASC(C$)
2190 UNTIL c%>47 AND c%<58 OR c%=45 OR
c%=46
2200 C=VAL(C$)
2210O=N/((C/100)+1)
2220 PRINT'
2230PRINTCHR$(131);"Original Value was
";CHR$(129);O
2240PROC`AGAIN
2250 ENDPROC
2260
2270 DEFPROC`C`TWO
2280 LOCAL c%
2290PRINT'
2300 REPEAT
2310 PRINTCHR$(130)"Enter O ";CHR$(13
5);:INPUT O;
2320 UNTIL O>0
2330 PRINT';
2340 REPEAT
2350 PRINTCHR$(130)"Enter C ";CHR$(13
5);:INPUT C$;
2360 c%=ASC(C$)
2370 UNTIL c%>47 AND c%<58 OR c%=45 OR
c%=46
2380 C=VAL(C$)
2390N=((C/100)*O)+O
2400 PRINT'
2410PRINTCHR$(131);"New Value is ";CHR$
(129);N
2420PROC`AGAIN
2430 ENDPROC
2440
2450 DEFPROC`C`THREE
2460 PRINT'
2470 REPEAT
2480 PRINTCHR$(130)"Enter O ";CHR$(13
5);:INPUT O;
2490 UNTIL O>0
2500 PRINT';
2510 REPEAT
2520 PRINTCHR$(130)"Enter N ";CHR$(13
5);:INPUT N;
2530 UNTIL N>=0
2540C=(N-O)/O*100
2550 PRINT'
2560PRINTCHR$(131);"Percentage change i
s";CHR$(129);C;CHR$(131);"%"
2570PROC`AGAIN
2580 ENDPROC
2590
2600 DEFPROC`P`ONE
2610 LOCAL m%
2620PRINT'
2630 REPEAT
2640 PRINTCHR$(130)"Enter M ";CHR$(13
5);:INPUT M$;
2650 m%=ASC(M$)
2660 UNTIL m%>47 AND m%<58 OR m%=45 OR
m%=46
2670 M=VAL(M$)
2680P=(M*100)/(M+100)
2690 PRINT'
2700PRINTCHR$(134);"Percentage Profit =
";CHR$(129);P;CHR$(134);"%"
2710PROC`AGAIN
2720 ENDPROC
2730
2740 DEFPROC`P`TWO
2750 LOCAL p%
2760PRINT'
2770 REPEAT
2780 PRINTCHR$(130)"Enter P ";CHR$(13
5);:INPUT P$;
2790 p%=ASC(P$)
2800 UNTIL p%>47 AND p%<58 OR p%=45 OR
p%=46
2810 P=VAL(P$)
2820M=(P*100)/(100-P)
2830 PRINT'
2840PRINTCHR$(134);"Percentage Markup =
";CHR$(129);M;CHR$(134);"%"
2850PROC`AGAIN
2860 ENDPROC
2870
2880
2890DEFPROC`AGAIN
2900 REPEAT
2910 PRINTTAB(6,23);CHR$(130);"Another
calculation ? (Y/N) "
2920 A$=GET$
2930 UNTIL A$="Y" OR A$="y" OR A$="N" O
R A$="n"
2940IF A$="Y" OR A$="y" THEN GOTO 220
2950 IF A$="N" OR A$="n" THEN PROC`FINI
TO
2960ENDPROC
2970
2980DEFPROC`CONTINUE
2990 REPEAT
3000 PRINTTAB(7,23);CHR$(130);"Press SP
ACE to continue"
3010 UNTIL GET$=" "
3020CLS
3030ENDPROC
3040
3050 DEFPROC`CENTRE(T$,Y%)
3060LOCAL Q%
3070Q% = 20-(LEN(T$)/2)
3080PRINTCHR$(Y%);TAB(Q%);T$
3090ENDPROC
3100
3110 DEFPROC`FINITO
3120 CLS
3130TIT$="Bye Bye" : C%=131
3140PROC`TITLE(TIT$,C%)
3150 END : ENDPROC
3160
3170 DEFPROCpmnote
3180 PRINT''
3190PRINT"Note that a profit of 100% me
ans that the selling price was";CHR$(1
34);"totally";CHR$(135);"profit. i.e.
the buying price was zero !"
3200 PRINT'"The program will therefore
not accept ";CHR$(134);"profit";CHR$(13
5);"input figures equalling or exc
eeding 100%, since this calls for a";
CHR$(134);"Markup";CHR$(135);"of Infinit
y % !"
3210ENDPROC
3220
3230 DEFPROC`TITLE(T$,Y%)
3240 VDU12,23;8202;0;0;0;
3250 CLS
3260 LOCAL Q%
3270 Q% = 18-(LEN(T$)/2)
3280 FOR I%=11 TO 12:PRINTTAB(Q%,I%);CH
R$(Y%);CHR$(141);T$:NEXT:VDU30
3290 T=TIME:REPEAT UNTIL TIME-T>300
3300 CLS
3310 VDU23;29194;0;0;0;
3320 ENDPROC
3330
3340 DEFPROC`LOGO
3350 VDU12,23;8202;0;0;0;
3360 VDU19,128,135;0;
3370 VDU19,1,2;0;
3380 PLOT4,160,128
3390 PLOT5,160,896
3400 PLOT5,1120,896
3410 PLOT5,1120,128
3420 PLOT5,160,128
3430 PLOT4,162,132
3440 PLOT5,162,892
3450 PLOT5,1118,892
3460 PLOT5,1118,132
3470 PLOT5,162,132
3480 PLOT0,2,0
3490 PLOT5,164,892
3500 PLOT4,1116,892
3510 PLOT5,1116,132
3520 PLOT0,0,4
3530 PLOT5,164,136
3540 PLOT5,164,888
3550 PLOT5,1116,888
3560 PLOT5,1116,136
3570 PLOT0,-2,0
3580 PLOT5,1114,888
3590 PLOT4,168,888
3600 PLOT5,168,136
3610 VDU29,600;700;
3620 PLOT4,0,0
3630 RESTORE
3640 READ X%,Y%
3650 PLOT4,X%,Y%
3660 PROC`DELAY(5)
3670 READ X%,Y%
3680 PLOT85,X%,Y%
3690 PROC`DELAY(5)
3700 P%=0
3710 FOR P%=1 TO 24
3720 PLOT4,0,0
3730 READ X%,Y%
3740 PLOT85,X%,Y%
3750 PROC`DELAY(5)
3760 READ X%,Y%
3770 PLOT85,X%,Y%
3780 PROC`DELAY(5)
3790 NEXT
3800 PLOT4,0,0
3810 READ X%,Y%
3820 PLOT85,X%,Y%
3830 PROC`DELAY(5)
3840PLOT4,-60,-175
3850P%=0
3860 RESTORE 4080
3870FOR P%=1TO9
3880READ X%,Y%
3890PLOT5,X%,Y%
3900NEXT
3910PLOT4,150,-198
3920P%=0
3930RESTORE 4090
3940FORP%=1TO8
3950READ X%,Y%
3960PLOT 5,X%,Y%
3970NEXT
3980 PLOT4,4,-150
3990 PLOT5,24,-175
4000 PLOT5,50,-212
4010 PLOT5,72,-168
4020 PLOT4,-94,-400
4030 PLOT5,236,-400
4040 PLOT0,-4,0
4050 PLOT5,-94,-400
4060 DATA0,125,25,112,50,100,75,87,100,
90,125,100,150,110,175,100,200,94,225,75
,250,25,250,0,250,-25,237,-50,248,-75,27
2,-100,284,-125,276,-150,220,-175,200,-1
88,175,-192,150,-198,125,-200,100,-205,7
5,-175,50,-182,25,-164,0,-150
4070 DATA-25,-156,-50,-175,-75,-216,-10
0,-226,-125,-226,-150,-218,-175,-188,-18
0,-150,-184,-125,-186,-100,-180,-75,-170
,-50,-160,-25,-140,0,-140,25,-150,50,-13
6,75,-125,80,-100,90,-75,112,-50,124,-25
,128,0,125
4080 DATA-20,-200,0,-225,12,-250,24,-27
5,24,-300,24,-325,24,-350,24,-375,18,-40
0
4090 DATA120,-225,110,-250,104,-275,104
,-300,104,-325,104,-350,116,-375,120,-40
0
4100 PRINTTAB(13,24);"B R O A D O A K"
4110 PROC`DELAY(500)
4120 VDU30
4130 VDU23;29194;0;0;0;
4140 ENDPROC
4150 DEFPROC`DELAY(T%)
4160 N%=TIME:REPEAT:UNTIL TIME-N%>T%
4170 ENDPROC