0 'FRACT.BA - BY PHIL WHEELER CLUB 100 LIBRARY - 415/939-1246 BBS, 937-5039 NEWSLETTER, 932-8856 VOICE 1 'This program asks for two fractions 2 'as input, adds them, and reduces the 3 'numerator and denominator until they 4 'have no common divisor. Input numer- 5 'ator, denominator must be no greater 6 'than 100. 7 ' ...Phil Wheeler 8 ' 9 ' 10 CLS:PRINT:INPUT"Fractions (A/B,C/D)";R$,S$:CLS:Z1=INSTR(R$,"/"):Z2=INSTR(S$,"/"):T=VAL(LEFT$(R$,Z1-1)):V=VAL(LEFT$(S$,Z2-1)):U=VAL(MID$(R$,Z1+1)):W=VAL(MID$(S$,Z2+1)):IF U>100 OR W>100 THEN CLS:PRINT@95,"BadInput":FORI=1TO500:NEXT:GOTO10 11 P=T*W+U*V:Q=U*W 12 READA:IFA>PORA>100THEN17 13 IFP/A<>INT(P/A)THEN12 14 IFQ/A<>INT(Q/A)THEN12 15 P=P/A:Q=Q/A:IFP=1THEN17ELSE13 16 DATA2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101 17 CLS:RESTORE:PRINT@80,T"/"U"+"V"/"W"="P"/"Q:PRINT:PRINT"Press any key to continue" 18 Q$=INKEY$:IFQ$=""THEN18ELSE10