MediaWiki:Sitenotice:
2024-03-02: The wiki ran out of disk space, so things were not working. This has been resolved by adding another 5GB of quota ;-) Thanks to Tim Lindner for reporting the issues. 2020-05-17: If a page gives you an error about some revision not being found, just EDIT the page and the old page should appear in the editor. If it does, just SAVE that and the page should be restored. OS-9 Al (talk) 12:22, 17 May 2020 (CDT)

OHMSLAW

From CoCopedia - The Tandy/Radio Shack Color Computer Wiki
Revision as of 11:16, 11 September 2015 by Polluks (talk | contribs) (Category)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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