Sitenotice: 11/29/2018: The wiki is back. It turns out, some anti-virus product on my web server had an issue with the latest version of PHP. My server techs have resolved this issue, and things should be working again. During the investigation, I did restore to a backup from September. There is a chance that any changes done since then were lost, but I do not recall any edits. --OS-9 Al

8/30/2016: Massive re-work is being done on the InfoBox Templates. Read that page to keep up with the plan for that, and adding better keyword tags (categories) to all the pages. --OS-9 Al (talk) 15:28, 31 August 2016 (CDT)

OHMSLAW

From CoCopedia - The Tandy/Radio Shack Color Computer Wiki
Jump to navigation Jump to search
100 CLEAR 500: CLS: PRINT@11,"OHM'S LAW"
110 PRINT@64,"SELECT ONE OF THE FOLLOWING:"
120 PRINT@96, "1. GIVEN E,R, FIND I (I=E/R)"
130 PRINT@128,"2. GIVEN E,I, FIND R (R=E/I)"
140 PRINT@160,"3. GIVEN R,I, FIND E (E=I*R)"
150 PRINT@192,"WHICH ONE";: INPUT A$
160 IF (VAL(A$)>0) AND (VAL(A$)<4) THEN 190
170 PRINT@448,"INVALID SELECTION--TRY AGAIN"
180 FOR I=1 TO 300: NEXT I: GOTO100
190 REM - PRINT FIGURE
200 B$=CHR$(140): C$=CHR$(207)
210 D$=CHR$(204): E$=CHR$(195)
220 L1$=B$+B$+BS+B$
230 L2$=C$+CS+C$+C$+E$+E$+E$+E$+C$+C$+C$+C$
240 L3$=C$+C$+C$+C$+C$+C$+C$+C$+C$+C$+C$+D5+B$
250 L4$=C$+C$+C$+C$+C$+C$+C$+C5+C5+C$+D$+D$+B5+B$
260 L5$=C5+C5+C$+C$+C$+C$+C$+C$+C$+C$+C$+C$
270 PRINT@301,L1$;: PRINT@329,L2$;
280 PRINT@361,L3$;: PRINT@393,L4$;
290 PRINT@425,L5$;
300 IF A$="2" THEN 340
310 PRINT@266,"R(OHMS)";: INPUT R$
320 IF (VAL(R$)>0) AND (VAL(R$)<99999999) THEN R=VAL(R$): GOTO340
330 PRINT@266,"": GOTO310
340 IF A$="3" THEN 390
350 PRINT@347,"E";: PRINT@376,"(VOLTS)";
360 PRINT@408,"";: INPUT E$
370 IF (VAL(E$)>0) AND (VAL(E$)<99999) THEN E=VAL(E$): GOTO390
380 PRINT@409," ";: GOTO360
390 IF AS="1" THEN 430
400 PRINT@454,"I(AMPERES)";: INPUT IS
410 IF (VAL(I$)>0) AND (VAL(I$)<99999999) THEN I=VAL(I$): GOTO46O
420 PRINT@454,"": GOTO400
430 I=E/R: I$=STR$(I)
440 PRINT@454,"I(AMPERES)";MID$(I$,2,14)
450 GOTO530
460 IF A$="3" THEN 500
470 R=E/I: R$=STR$(R)
480 PRINT@266,"R(OHMS)";MIDS(R$,2,13)
490 GOTO530
500 E=I*R: E$=STR$(E)
510 PRINT@347,"E";: PRINT@376,"(VOLTS)"
520 PRINT@408,MID$(E$,2,6)
530 PRINT@480,"PRESS ANY KEY TO CONTINUE";: A$=INKEY$
540 IF A$="" THEN 530
550 GOTO100