Ohm’s Law Formulas

Developer(s): Roy Babylon
Date: 1979
Type: Program
Platform(s): TS 2068

Ohm’s Law Formulas asks which quantity you want — resistance, current, voltage or power, numbered 1 to 4 — then asks for the values it needs and prints the answer. For power it asks which of resistance, current or voltage is the missing one and uses the matching formula: I × E, E²/R or I²R.

Line 1 reads “OHMS LAW BY ROY BABYLON POPULAR ELECTRONICS AUG 1979”. The same article was the source of the Resonance and Inductive Formulas programs linked below, which were on the same disk.

Program Analysis

Lines 5–8 set R, C, V and P to 1–4 so the menu answer can be compared with IF A=R and so on. Each branch is a pair of INPUTs and a PRINT followed by STOP.

Potential Issues

  • The voltage choice (3) goes to line 150, which asks only for the current and then prints a resistance using E, which has not been entered, so it stops with “Variable not found”. The voltage formula at line 170 can never be reached.
  • In the power branch the answer to “missing variable” is compared with R, I and E; I and E only exist after an earlier calculation, so choosing current or voltage first stops with “Variable not found”.
  • Entering a value for R in one calculation also changes the menu code for resistance (line 130 reuses R), so later menu choices may go to the wrong branch.
  • The title is printed at TAB 20 and wraps onto the next line.

This copy came from a Larken disk; only the disk save and menu lines were removed. Tested in ZEsarUX: the current calculation works.

Related Content

Image Gallery

Source Code

    1 REM OHMS LAW BY ROY BABYLON POPULAR ELECTRONICS AUG 1979
    5 LET R=1
    6 LET C=2
    7 LET V=3
    8 LET P=4
   15 CLS 
   20 PRINT TAB 20;"OHM'S LAW FORMULAS"
   30 PRINT "SELECT NUMBER FOR DESIRED FUNCTION"
   40 INPUT "RESISTANCE=R,CURRENT=C,VOLTAGE=V,POWER=P";A
   50 IF A=R THEN GO TO 90
   60 IF A=C THEN GO TO 120
   70 IF A=V THEN GO TO 150
   80 IF A=P THEN GO TO 180
   90 INPUT "ENTER VOLTAGE IN VOLTS";E
  100 INPUT "ENTER CURRENT IN AMPERES";I
  110 PRINT "THE RESISTANCE EQUALS";E/I;"OHMS": STOP 
  120 INPUT "ENTER VOLTAGE IN VOLTS";E
  130 INPUT "ENTER RESISTANCE IN OHMS";R
  140 PRINT "THE CURRENT IS EQUAL TO";E/R;"AMPERES": STOP 
  150 INPUT "ENTER CURRENT IN AMPERES";I
  160 PRINT "THE RESISTANCE EQUALS";E/I;"OHMS": STOP 
  170 PRINT "THE VOLTAGE IS";I*R;"VOLTS WITH";R;"OHMS AND ";I;"AMPERES": STOP 
  180 INPUT "ENTER MISSING VARIABLE R,I,E";B
  190 IF B=R THEN GO TO 220
  200 IF B=I THEN GO TO 250
  210 IF B=E THEN GO TO 280
  220 INPUT "ENTER CURRENT (I)";I
  230 INPUT "ENTER VOLTAGE (E)";E
  240 LET P=I*E: GO TO 310
  250 INPUT "ENTER VOLTAGE (E)";E
  260 INPUT "ENTER RESISTANCE (R)";R
  270 LET P=(E*E)/R: GO TO 310
  280 INPUT "ENTER CURRENT (I)";I
  290 INPUT "ENTER RESISTANCE (R)";R
  300 LET P=(I*I)*R
  310 PRINT "THE POWER IS ";P;" WATTS"
  320 STOP 
 9989 STOP 
 9992 REM  removed (LKDOS-only)
 9998 REM  removed (LKDOS-only)
 9999 GO TO VAL "80"

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.