ChipMaster's bwBASIC This also includes history going back to v2.10. *WARN* some binary files might have been corrupted by CRLF.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

312 lines
12 KiB

  1. 5 REM - COMPACTED:6/08/84
  2. 7 REM - Removed LPRINT references 4-13-2020 Ken
  3. 10 PRINT " -=*OHM'S LAW*=-"
  4. 40 PRINT " MENU"
  5. 50 PRINT:PRINT TAB(10);"(1) Find I, given VOLTAGE and RESISTANCE (E and R)"
  6. 70 PRINT TAB(10);"(2) Find R, given VOLTAGE and CURRENT (V and I)"
  7. 90 PRINT TAB(10);"(3) Find E, given CURRENT and RESISTANCE (I and R)"
  8. 110 PRINT TAB(10);"(4) Find P (POWER), given VOLTAGE and CURRENT (E and I)"
  9. 130 PRINT TAB(10);"(5) Find P (POWER), given CURRENT and RESISTANCE (I and R)"
  10. 150 PRINT TAB(10);"(6) Find P (POWER), given VOLTAGE and RESISTANCE (E and R)"
  11. 170 PRINT TAB(10);"(7) Find two resistances in parallel, given R1 and R2"
  12. 190 PRINT TAB(10);"(8) Find RT, given unequal R1, R2, R3, R4 in parallel"
  13. 270 PRINT TAB(10);"(9) Find RT, given R1,R2,R3,R4 in SERIES-PARALLEL"
  14. 290 PRINT TAB(10);"(10) Find TOTAL CAPACITANCE (CT), in series circuit"
  15. 310 PRINT TAB(10);"(11) Find TOTAL CAPACITANCE (CT), 2 caps, parallel circuit"
  16. 330 PRINT TAB(10);"(12) Find TOTAL CAPACITANCE (CT), 3 caps in parallel"
  17. 350 PRINT TAB(10);"(13) Find PEAK AC VOLTAGE, given RMS value"
  18. 370 PRINT TAB(10);"(14) Find RMS VOLTAGE, given PEAK value"
  19. 390 PRINT TAB(10);"(15) Find INDUCTIVE REACTANCE (XL)"
  20. 410 PRINT TAB(10);"(16) Find CAPACITIVE REACTANCE (XC)"
  21. 430 PRINT TAB(10);"(17) Find IMPEDANCE (Z) of a series circuit"
  22. 445 PRINT TAB(10);"(18) Find IMPEDANCE (Z) of a parallel circuit"
  23. 447 PRINT
  24. 450 PRINT " Select the number you require from the menu and press 'RETURN'"
  25. 485 PRINT
  26. 490 INPUT "Caps Lock ON. Enter choice from above or -1 to exit :",C
  27. 515 IF C = -1 THEN END
  28. 517 PRINT "Choice is:";C
  29. 520 IF C= 0 OR C> 18 THEN 10
  30. 530 ON C GOTO 540,710,880,1050,1220,1380,1540,1700,1930,2190,2360,2560,2770,2930,3070,3260,3430,3680
  31. 540 PRINT "Calculate CURRENT (I), given VOLTAGE and RESISTANCE (E and R)"
  32. 555 PRINT
  33. 560 INPUT "What is the value of E, in volts:",V
  34. 580 INPUT "Now enter the value of R, in ohms:",R
  35. 600 LET I= (V/R)
  36. 610 PRINT " I= ";(V/R);"amperes"
  37. 630 PRINT
  38. 640 PRINT " Do you wish to do this calculation again? (Y/N)":INPUT ANS$
  39. 660 IF ANS$="Y" THEN 540
  40. 670 PRINT "Do you wish to return to the menu? (Y/N)":INPUT ANS$
  41. 690 IF ANS$="Y" THEN 10
  42. 700 GOTO 10020
  43. 710 PRINT "Calculate RESISTANCE (R), given VOLTAGE and CURRENT (E and I)"
  44. 730 PRINT:PRINT
  45. 740 INPUT "Input the value of E, in volts:",V
  46. 760 INPUT "Now enter the value of I, in amperes:",I
  47. 780 LET R=(V/I):PRINT "R= ";(V/I);"ohms"
  48. 800 PRINT
  49. 810 PRINT "Do you wish to do this calculation again? (Y/N)":INPUT ANS$
  50. 830 IF ANS$="Y" THEN 710
  51. 835 PRINT
  52. 840 PRINT "Do you wish to return to the menu? (Y/N)":INPUT ANS$
  53. 860 IF ANS$="Y" THEN 10
  54. 870 GOTO 10020
  55. 875 PRINT
  56. 880 PRINT "Calculate VOLTAGE (E), given CURRENT and RESISTANCE (I and R)"
  57. 895 PRINT
  58. 900 INPUT "Enter the value for I, in amperes:",I
  59. 920 INPUT "Now enter the value for R, in ohms:",R
  60. 940 LET E=(I*R):PRINT "E= ";(I*R);"volts"
  61. 960 PRINT
  62. 970 PRINT "Do you wish to do this calculation again? (Y/N)":INPUT ANS$
  63. 990 IF ANS$="Y" THEN 880
  64. 995 PRINT
  65. 1000 PRINT "Do you wish to return to the menu? (Y/N)":INPUT ANS$
  66. 1020 IF ANS$="Y" THEN 10
  67. 1030 GOTO 10020
  68. 1040 PRINT
  69. 1050 PRINT "Calculate POWER(P), given VOLTAGE(E) and CURRENT(I)"
  70. 1065 PRINT
  71. 1070 INPUT "Input the value for E, in volts:",V
  72. 1090 INPUT "Now enter the value for I, in amperes:",I
  73. 1110 LET P=V*I:PRINT "I= ";(V*I);"watts"
  74. 1130 PRINT
  75. 1140 PRINT "Do you wish to do this calculation again? (Y/N)":INPUT ANS$
  76. 1160 IF ANS$="Y" THEN 1050
  77. 1175 PRINT
  78. 1180 PRINT "Do you wish to return to the menu? (Y/N)":INPUT ANS$
  79. 1200 IF ANS$="Y" THEN 10
  80. 1210 GOTO 10020
  81. 1220 PRINT "Calculate POWER(P), given CURRENT(I) and RESISTANCE(R)"
  82. 1235 PRINT
  83. 1240 INPUT "Enter the value for I, in amperes:",I
  84. 1260 INPUT "Now enter the value for R, in ohms:",R
  85. 1280 LET P=(I*I)*R:PRINT "P= ";(I*I)*R;"watts"
  86. 1300 PRINT
  87. 1310 PRINT "Do you wish to do this calculation again? (Y/N)":INPUT ANS$
  88. 1330 IF ANS$="Y" THEN 1220
  89. 1335 PRINT
  90. 1340 PRINT "Do you wish to return to the menu? (Y/N)":INPUT ANS$
  91. 1360 IF ANS$="Y" THEN 10
  92. 1370 GOTO 10020
  93. 1380 PRINT "Calculate POWER(P), given VOLTAGE(E) and RESISTANCE(R)"
  94. 1385 PRINT
  95. 1400 INPUT "Enter the value for E, in volts:",V
  96. 1420 INPUT "Now enter the value for R, in ohms:",R
  97. 1440 LET P=(V*V)/(R):PRINT "P= ";(V*V)/(R);"watts"
  98. 1460 PRINT
  99. 1470 PRINT "Do you wish to do this calculation again ? (Y/N)":INPUT ANS$
  100. 1490 IF ANS$="Y" THEN 1380
  101. 1495 PRINT
  102. 1500 PRINT "Do you wish to return to the menu? (Y/N)":INPUT ANS$
  103. 1520 IF ANS$="Y" THEN 10
  104. 1530 GOTO 10020
  105. 1535 PRINT
  106. 1540 PRINT "Calculate TOTAL RESISTANCE(RT) in parallel, given R1,R2"
  107. 1555 PRINT
  108. 1560 INPUT "Input the value for R1:",R1
  109. 1580 INPUT "Now input the value for R2:",R2
  110. 1600 LET RT= (R1*R2)/(R1+R2):PRINT "RT= ";(R1*R2)/(R1+R2);"ohms"
  111. 1620 PRINT
  112. 1630 PRINT "Do you wish to do this calculation again? (Y/N)":INPUT ANS$
  113. 1650 IF ANS$="Y" THEN 1540
  114. 1655 PRINT
  115. 1660 PRINT "Do you wish to return to the menu? (Y/N)":INPUT ANS$
  116. 1680 IF ANS$="Y" THEN 10
  117. 1690 GOTO 10020
  118. 1695 PRINT
  119. 1700 PRINT "Calculate TOTAL RESISTANCE(RT), given unequal R1,R2,R3,R4 values"
  120. 1715 PRINT
  121. 1720 PRINT "Enter the values for R1,R2,R3 and R4, in ohms"
  122. 1740 INPUT "R1=",R1
  123. 1750 INPUT "R2=",R2
  124. 1760 INPUT "R3=",R3
  125. 1770 INPUT "R4=",R4
  126. 1780 PRINT "R1=";R1;"ohms"
  127. 1790 PRINT "R2=";R2;"ohms"
  128. 1800 PRINT "R3=";R3;"ohms"
  129. 1810 PRINT "R4=";R4;"ohms"
  130. 1820 LET RT=(1)/(1/R1+1/R2+1/R3+1/R4)
  131. 1830 PRINT "RT= ";(1)/(1/R1+1/R2+1/R3+1/R4);"ohms"
  132. 1850 PRINT
  133. 1860 PRINT "Do you wish to do this calculation again? (Y/N)":INPUT ANS$
  134. 1880 IF ANS$="Y" THEN 1700
  135. 1885 PRINT
  136. 1890 PRINT "Do you wish to return to the menu? (Y/N)":INPUT ANS$
  137. 1910 IF ANS$="Y" THEN 10
  138. 1920 GOTO 10020
  139. 1925 PRINT
  140. 1930 PRINT "Calculate TOTAL RESISTANCE(RT), in series-parallel,"
  141. 1940 PRINT "given R1, R2, R3 and R4"
  142. 1965 PRINT
  143. 1970 PRINT "Enter the values for R1, R2, R3 and R4"
  144. 1990 INPUT "R1=",R1
  145. 2000 INPUT "R2=",R2
  146. 2010 INPUT "R3=",R3
  147. 2020 INPUT "R4=",R4
  148. 2030 PRINT "R1=";R1;"ohms"
  149. 2040 PRINT "R2=";R2;"ohms"
  150. 2050 PRINT "R3=";R3;"ohms"
  151. 2060 PRINT "R4=";R4;"ohms"
  152. 2070 PRINT
  153. 2080 LET RT=(1)/(1/(R1+R2))+(1/(R3+R4))
  154. 2090 PRINT "RT=";(1)/(1/(R1+R2))+(1/(R3+R4));"ohms"
  155. 2110 PRINT
  156. 2120 PRINT "Do you wish to do this calculation again? (Y/N)":INPUT ANS$
  157. 2140 IF ANS$="Y" THEN 1930
  158. 2145 PRINT
  159. 2150 PRINT "Do you wish to return to the menu? (Y/N)":INPUT ANS$
  160. 2170 IF ANS$="Y" THEN 10
  161. 2180 GOTO 10020
  162. 2185 PRINT
  163. 2190 PRINT "Calculate TOTAL CAPACITANCE(CT), in series circuit, given C1 and C2"
  164. 2205 PRINT
  165. 2210 INPUT "Enter value for C1, in MFD:",C1
  166. 2220 INPUT "Now enter the value for C2, in MFD:",C2
  167. 2240 PRINT "C1=";C1;"mfd"
  168. 2250 PRINT "C2=";C2;"mfd"
  169. 2260 LET CT=(C1*C2)/(C1+C2):PRINT "CT=";(C1*C2)/(C1+C2);"mfd"
  170. 2280 PRINT
  171. 2290 PRINT "Do you wish to do this calculation again? (Y/N)":INPUT ANS$
  172. 2310 IF ANS$="Y" THEN 2190
  173. 2315 PRINT
  174. 2320 PRINT "Do you wish to return to the menu? (Y/N)":INPUT ANS$
  175. 2340 IF ANS$="Y" THEN 10
  176. 2350 GOTO 10020
  177. 2355 PRINT
  178. 2360 PRINT "Calculate TOTAL CAPACITANCE(CT), parallel circuit, given C1 and C2"
  179. 2395 PRINT
  180. 2400 INPUT "Enter the value for C1, in mfd:",C1
  181. 2420 INPUT "Now enter the value for C2, in mfd:",C2
  182. 2440 PRINT "C1=";C1;"mfd"
  183. 2450 PRINT "C2=";C2;"mfd"
  184. 2460 LET CT=(C1*C2)/(C1+C2):PRINT "CT=";(C1*C2)/(C1+C2);"mfd"
  185. 2480 PRINT
  186. 2490 PRINT "Do you wish to do this calculation again? (Y/N)":INPUT ANS$
  187. 2510 IF ANS$="Y" THEN 2360
  188. 2515 PRINT
  189. 2520 PRINT "Do you wish to return to the menu? (Y/N)":INPUT ANS$
  190. 2540 IF ANS$="Y" THEN 10
  191. 2550 GOTO 10020
  192. 2555 PRINT
  193. 2560 PRINT "Calculate TOTAL CAPACITANCE(CT) for a parallel circuit,"
  194. 2570 PRINT "given C1, C2 and C3, in mfd"
  195. 2595 PRINT
  196. 2600 INPUT "C1=",C1
  197. 2610 INPUT "C2=",C2
  198. 2620 INPUT "C3=",C3
  199. 2630 PRINT "C1=";C1;"mfd"
  200. 2640 PRINT "C2=";C2;"mfd"
  201. 2650 PRINT "C3=";C3;"mfd"
  202. 2660 PRINT
  203. 2670 LET CT=(C1+C2+C3):PRINT "CT=";(C1+C2+C3);"mfd"
  204. 2690 PRINT
  205. 2700 PRINT "D0 you wish to do this calculation again? (Y/N)":INPUT ANS$
  206. 2720 IF ANS$="Y" THEN 2560
  207. 2725 PRINT
  208. 2730 PRINT "Do you wish to return to the menu? (Y/N)":INPUT ANS$
  209. 2750 IF ANS$="Y" THEN 10
  210. 2760 GOTO 10020
  211. 2765 PRINT
  212. 2770 PRINT "Calculate PEAK AC VOLTAGE, given RMS value"
  213. 2785 PRINT
  214. 2790 INPUT "Enter the RMS value, in volts:",RMS
  215. 2810 PRINT "RMS=";RMS;"volts"
  216. 2820 LET PEAK=(RMS*1.414):PRINT "PEAK=";(RMS*1.414);"volts"
  217. 2840 PRINT
  218. 2850 PRINT "Do you wish to do this calculation again? (Y/N)":INPUT ANS$
  219. 2870 IF ANS$="Y" THEN 2770
  220. 2875 PRINT
  221. 2880 PRINT "Do you wish to return to the menu? (Y/N)":INPUT ANS$
  222. 2900 IF ANS$="Y" THEN 10
  223. 2910 GOTO 10020
  224. 2920 PRINT
  225. 2930 PRINT "Calculate RMS VOLTAGE, given a value in PEAK VOLTS"
  226. 2945 PRINT
  227. 2950 INPUT "Enter the PEAK value, in volts AC:",PEAK
  228. 2960 PRINT "PEAK VOLTS=";PEAK
  229. 2970 LET RMS=(.707*PEAK):PRINT "RMS=";(.707*PEAK);"volts AC"
  230. 3000 PRINT "Do you wish to do this calculation again? (Y/N)":INPUT ANS$
  231. 3020 IF ANS$="Y" THEN 2930
  232. 3025 PRINT
  233. 3030 PRINT "Do you wish to return to the menu? (Y/N)":INPUT ANS$
  234. 3050 IF ANS$="Y" THEN 10
  235. 3060 GOTO 10020
  236. 3065 PRINT
  237. 3070 PRINT "Calculate INDUCTIVE REACTANCE (XL), given FREQUENCY and INDUCTANCE"
  238. 3090 PRINT
  239. 3100 INPUT "Enter FREQUENCY (F), in Hertz:",FREQ
  240. 3120 PRINT "FREQUENCY=";FREQ;"Hertz
  241. 3130 INPUT "Now enter the value for INDUCTANCE (L), in henrys:",L
  242. 3150 PRINT "INDUCTANCE=";L;"henrys"
  243. 3160 LET XL=(2*3.1416)*FREQ*L:PRINT "XL=";(2*3.1416)*FREQ*L;"ohms"
  244. 3180 PRINT
  245. 3190 PRINT "Do you wish to do this calculation again? (Y/N)":INPUT ANS$
  246. 3210 IF ANS$="Y" THEN 3070
  247. 3215 PRINT
  248. 3220 PRINT "Do you wish to return to the menu? (Y/N)":INPUT ANS$
  249. 3240 IF ANS$="Y" THEN 10
  250. 3245 GOTO 10020
  251. 3250 PRINT
  252. 3260 PRINT "Calculate CAPACITIVE REACTANCE (XC), given FREQ(F) and CAP(C)"
  253. 3275 PRINT
  254. 3280 INPUT "Enter the value for FREQ(F), in Hertz:",F
  255. 3290 PRINT "FREQ(F)=";F;"Hertz"
  256. 3300 INPUT "Now enter the value for CAP(C), in mfd:",C
  257. 3310 PRINT "CAP(C)=";C;"mfd"
  258. 3320 PRINT
  259. 3330 LET XC=(1)/((2*3.1416)*F*C):PRINT "XC=";(1)/((2*3.1416)*F*C);"ohms"
  260. 3350 PRINT
  261. 3360 PRINT "Do you wish to do this calculation again? (Y/N)":INPUT ANS$
  262. 3380 IF ANS$="Y" THEN 3260
  263. 3385 PRINT
  264. 3390 PRINT "Do you wish to return to the menu? (Y/N)":INPUT ANS$
  265. 3410 IF ANS$="Y" THEN 10
  266. 3415 GOTO 10020
  267. 3420 PRINT
  268. 3430 PRINT "Calculate IMPEDANCE(Z) of a series circuit, given values of"
  269. 3435 PRINT "RES(R), CAPACITIVE REACTANCE(XC) and INDUCTIVE REACTANCE(XL)"
  270. 3446 PRINT
  271. 3450 INPUT "Enter the value for RESISTANCE(R), in ohms:",R
  272. 3470 INPUT "Enter the value for CAPACITIVE REACTANCE(XC), in ohms:",XC
  273. 3490 INPUT "Enter the value for INDUCTIVE REACTANCE(XL), in ohms:",XL
  274. 3510 PRINT
  275. 3520 PRINT "RESISTANCE(R)=";R;"ohms"
  276. 3530 PRINT "CAPACITIVE REACTANCE(XC)=";XC;"ohms"
  277. 3540 PRINT "INDUCTIVE REACTANCE(XL)=";XL;"ohms"
  278. 3550 PRINT
  279. 3560 LET Z=SQR(R^2+((XL-XC)^2))
  280. 3570 PRINT "IMPEDANCE(Z)=";SQR(R^2+((XL-XC)^2));"ohms"
  281. 3590 PRINT
  282. 3600 PRINT "Do you wish to do this calculation again? (Y/N)":INPUT ANS$
  283. 3620 IF ANS$="Y" THEN 3430
  284. 3625 PRINT
  285. 3630 PRINT "Do you wish to return to the menu? (Y/N)":INPUT ANS$
  286. 3650 IF ANS$="Y" THEN 10
  287. 3660 GOTO 10020
  288. 3670 PRINT
  289. 3680 PRINT "Calculate IMPEDANCE (Z) of a parallel circuit"
  290. 3700 PRINT
  291. 3710 INPUT "Enter the value of L, in henrys:",L
  292. 3730 INPUT "Enter the value for FREQ (F), in Hertz:",F
  293. 3750 INPUT "Now enter the value for RESISTANCE (R) in ohms:",R
  294. 3765 PRINT "INDUCTANCE (L)=";L;"henrys"
  295. 3770 PRINT "FREQ (F)=";F;" Hertz"
  296. 3775 PRINT "RESISTANCE (R)=";R;"ohms"
  297. 3776 PRINT
  298. 3780 LET Z=((2*3.1416*F*L)^2)/(R)
  299. 3790 PRINT "IMPEDANCE (Z)=";((2*3.1416*F*L)^2)/(R);"ohms"
  300. 3810 PRINT "Do you wish to do this calculation again? (Y/N)":INPUT ANS$
  301. 3830 IF ANS$="Y" THEN 3680
  302. 3840 PRINT
  303. 3850 PRINT "Do you wish to return to the menu? (Y/N)":INPUT ANS$
  304. 3870 IF ANS$="Y" THEN 10
  305. 3880 GOTO 10020
  306. 3890 PRINT
  307. 10020 PRINT "Glad to have been of service! BYE!!
  308. 12000 REM --------------------------------------------------------------------------
  309. 12010 REM Change line number 0 to line number 5
  310. 12020 REM For automated testing, added 515 IF C = -1 THEN END
  311. 12999 END