Home » Personal collection » Acorn ADFS disks » Electron » MTF_finished_programs.ADF » TAPE3/A/EQUATIONS

TAPE3/A/EQUATIONS

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Personal collection » Acorn ADFS disks » Electron » MTF_finished_programs.ADF
Filename: TAPE3/A/EQUATIONS
Read OK:
File size: 01DD bytes
Load address: FFFF0E00
Exec address: FFFF8023
Duplicates

There are 4 duplicate copies of this file in the archive:

File contents
    5 REM Simultaneous Equation Solver
   10 MODE 6:PRINT TAB(2,2)"A x  +  B y  =  P";TAB(2,4)"C x  +  D y  =  Q"
   20 INPUT TAB(2,8)"Enter Value for ""A"":"a,TAB(18)"""B"":"b,TAB(18)"""P"":"P,TAB(18)"""C"":"c,TAB(18)"""D"":"d,TAB(18)"""Q"":"Q
   30 CLS:PRINT TAB(2,2);a"x  +  "b"y  =  "P;TAB(2,4)c"x  +  "d"y  =  "Q
   40 IF a<0 THEN a=-a:b=-b:P=-P
   50 IF c<0 THEN c=-c:d=-d:Q=-Q
   60 b=b*c:P=P*c:d=d*a:Q=Q*a:c=c*a:b=b-d:P=P-Q:y=P/b:x=(Q-d*y)/c
   70 PRINT TAB(2,15);"x  =  "x;TAB(2,17)"y  =  "y
   80 PRINT TAB(2,23);"Press any key for another equation":A$=GET$:RUN
# � Simultaneous Equation Solver

< � 6:� �2,2)"A x  +  B y  =  P";�2,4)"C x  +  D y  =  Q"
k � �2,8)"Enter Value for ""A"":"a,�18)"""B"":"b,�18)"""P"":"P,�18)"""C"":"c,�18)"""D"":"d,�18)"""Q"":"Q
; �:� �2,2);a"x  +  "b"y  =  "P;�2,4)c"x  +  "d"y  =  "Q
( � a<0 � a=-a:b=-b:P=-P
2 � c<0 � c=-c:d=-d:Q=-Q
<@ b=b*c:P=P*c:d=d*a:Q=Q*a:c=c*a:b=b-d:P=P-Q:y=P/b:x=(Q-d*y)/c
F' � �2,15);"x  =  "x;�2,17)"y  =  "y
P9 � �2,23);"Press any key for another equation":A$=�:�
�
00000000  0d 00 05 23 20 f4 20 53  69 6d 75 6c 74 61 6e 65  |...# . Simultane|
00000010  6f 75 73 20 45 71 75 61  74 69 6f 6e 20 53 6f 6c  |ous Equation Sol|
00000020  76 65 72 0d 00 0a 3c 20  eb 20 36 3a f1 20 8a 32  |ver...< . 6:. .2|
00000030  2c 32 29 22 41 20 78 20  20 2b 20 20 42 20 79 20  |,2)"A x  +  B y |
00000040  20 3d 20 20 50 22 3b 8a  32 2c 34 29 22 43 20 78  | =  P";.2,4)"C x|
00000050  20 20 2b 20 20 44 20 79  20 20 3d 20 20 51 22 0d  |  +  D y  =  Q".|
00000060  00 14 6b 20 e8 20 8a 32  2c 38 29 22 45 6e 74 65  |..k . .2,8)"Ente|
00000070  72 20 56 61 6c 75 65 20  66 6f 72 20 22 22 41 22  |r Value for ""A"|
00000080  22 3a 22 61 2c 8a 31 38  29 22 22 22 42 22 22 3a  |":"a,.18)"""B"":|
00000090  22 62 2c 8a 31 38 29 22  22 22 50 22 22 3a 22 50  |"b,.18)"""P"":"P|
000000a0  2c 8a 31 38 29 22 22 22  43 22 22 3a 22 63 2c 8a  |,.18)"""C"":"c,.|
000000b0  31 38 29 22 22 22 44 22  22 3a 22 64 2c 8a 31 38  |18)"""D"":"d,.18|
000000c0  29 22 22 22 51 22 22 3a  22 51 0d 00 1e 3b 20 db  |)"""Q"":"Q...; .|
000000d0  3a f1 20 8a 32 2c 32 29  3b 61 22 78 20 20 2b 20  |:. .2,2);a"x  + |
000000e0  20 22 62 22 79 20 20 3d  20 20 22 50 3b 8a 32 2c  | "b"y  =  "P;.2,|
000000f0  34 29 63 22 78 20 20 2b  20 20 22 64 22 79 20 20  |4)c"x  +  "d"y  |
00000100  3d 20 20 22 51 0d 00 28  1b 20 e7 20 61 3c 30 20  |=  "Q..(. . a<0 |
00000110  8c 20 61 3d 2d 61 3a 62  3d 2d 62 3a 50 3d 2d 50  |. a=-a:b=-b:P=-P|
00000120  0d 00 32 1b 20 e7 20 63  3c 30 20 8c 20 63 3d 2d  |..2. . c<0 . c=-|
00000130  63 3a 64 3d 2d 64 3a 51  3d 2d 51 0d 00 3c 40 20  |c:d=-d:Q=-Q..<@ |
00000140  62 3d 62 2a 63 3a 50 3d  50 2a 63 3a 64 3d 64 2a  |b=b*c:P=P*c:d=d*|
00000150  61 3a 51 3d 51 2a 61 3a  63 3d 63 2a 61 3a 62 3d  |a:Q=Q*a:c=c*a:b=|
00000160  62 2d 64 3a 50 3d 50 2d  51 3a 79 3d 50 2f 62 3a  |b-d:P=P-Q:y=P/b:|
00000170  78 3d 28 51 2d 64 2a 79  29 2f 63 0d 00 46 27 20  |x=(Q-d*y)/c..F' |
00000180  f1 20 8a 32 2c 31 35 29  3b 22 78 20 20 3d 20 20  |. .2,15);"x  =  |
00000190  22 78 3b 8a 32 2c 31 37  29 22 79 20 20 3d 20 20  |"x;.2,17)"y  =  |
000001a0  22 79 0d 00 50 39 20 f1  20 8a 32 2c 32 33 29 3b  |"y..P9 . .2,23);|
000001b0  22 50 72 65 73 73 20 61  6e 79 20 6b 65 79 20 66  |"Press any key f|
000001c0  6f 72 20 61 6e 6f 74 68  65 72 20 65 71 75 61 74  |or another equat|
000001d0  69 6f 6e 22 3a 41 24 3d  be 3a f9 0d ff           |ion":A$=.:...|
000001dd
TAPE3/A/EQUATIONS.m0
TAPE3/A/EQUATIONS.m1
TAPE3/A/EQUATIONS.m2
TAPE3/A/EQUATIONS.m4
TAPE3/A/EQUATIONS.m5