10 REM: FINDCAP (C) J.Fields, 24 Feb.1987
15 COLOR 7, 0
20 CLS
30 PI = 3.141592654#
40 PRINT ""
50 PRINT " This program solves for the capacitance of a parallel plate capacitor."
60 PRINT ""
61 GOTO 70
62 CLS
63 PRINT ""
70 INPUT " Do you wish to use English or Metric units ? ", U$
80 IF U$ = "e" OR U$ = "m" THEN 120
100 PRINT "That is not a valid response. Enter e for English or m for Metric."
110 GOTO 70
120 IF U$ = "e" THEN CK = .225 ELSE CK = .0885
130 INPUT " Do you wish to specify area or dimensions of the plates ? ", Z$
140 IF Z$ = "d" THEN 220
150 IF U$ = "e" AND Z$ = "a" THEN INPUT " Enter area of one face of one plate in square inches: ", A: IF A <= 0 THEN 371 ELSE 340
160 IF U$ = "m" AND Z$ = "a" THEN INPUT " Enter area of one face of one plate in square meters: ", AM: IF AM <= 0 THEN 371 ELSE 180
170 PRINT "That is not a valid response. Enter a for area or d for dimensions.": GOTO 130
180 A = AM * 10000
190 INPUT " Enter plate separation in meters: ", SM
200 S = SM * 100
210 GOTO 350
220 INPUT " Are the capacitor plates rectangular or circular ? ", G$
230 IF G$ = "r" OR G$ = "c" THEN 270
240 PRINT "That is not a valid response. Enter r for rectangular or c for circular.": GOTO 220
270 IF U$ = "m" AND G$ = "r" THEN 460
280 IF U$ = "e" AND G$ = "r" THEN 310
290 IF U$ = "m" AND G$ = "c" THEN 560
300 IF U$ = "e" AND G$ = "c" THEN 620
310 INPUT " Enter length in inches: ", L: IF L <= 0 THEN 371
320 INPUT " Enter width in inches: ", W: IF W <= 0 THEN 371
330 A = L * W
340 INPUT " Enter plate separation in inches: ", S
341 IF S <= 0 THEN PRINT "Separation must be positive and non-zero.": GOTO 340
350 INPUT " Enter number of plates:(2 or more) ", N
351 IF N < 2 THEN PRINT "Must be at least 2 plates.": GOTO 350
360 INPUT " Enter dielectric constant: ", K
370 C = (CK * K) * (N - 1) * (A / S): COLOR 14, 0: GOTO 380
371 COLOR 14, 0: C = 0
380 IF U$ = "m" THEN 540
390 IF C >= 1000000! AND C < 1E+12 THEN PRINT " Capacitance ="; C * .000001; "microfarads.": GOTO 420
400 IF C >= 1E+12 THEN PRINT " Capacitance ="; C * 1E-12; "Farads.": GOTO 420
410 PRINT " Capacitance ="; C; "picofarads."
420 COLOR 7, 0: PRINT " Another run ? "
430 R$ = INPUT$(1)
440 IF R$ = "y" THEN 62 ELSE CLS : COLOR 14, 0: PRINT " Goodbye from FINDCAP "; CHR$(1); " "; DATE$; " "; TIME$
450 PRINT " Austin Instruments,Inc. Austin, Texas U.S.A.": COLOR 7, 0: SYSTEM
460 INPUT " Enter length in meters: ", LM: IF LM <= 0 THEN 371
470 L = LM * 100
480 INPUT " Enter width in meters: ", WM: IF WM <= 0 THEN 371
490 W = WM * 100
500 A = L * W
510 INPUT " Enter plate separation in meters: ", SM
511 IF SM <= 0 THEN PRINT "Separation must be positive and non-zero."; GOTO510
520 S = SM * 100
530 GOTO 350
540 PRINT " Capacitance ="; C * 1E-12; "Farad."
550 GOTO 420
560 INPUT " Enter diameter in meters: ", DM: IF DM <= 0 THEN 371
570 D = DM * 100
580 A = PI * ((D / 2) ^ 2)
590 INPUT " Enter plate separation in meters: ", SM
591 IF SM <= 0 THEN PRINT "Separation must be positive and non-zero"; GOTO590
600 S = SM * 100
610 GOTO 350
620 INPUT " Enter diameter in inches: ", DI: IF DI <= 0 THEN 371
630 A = PI * ((DI / 2) ^ 2)
640 GOTO 340