UNIT B.6 — COMPUTING

Programming fundamentals

BRIDGE · EE Foundations Bridge · ~10 min

Community content — not verified by a licensed electrician. Lessons and questions here are written for study practice and pinned to NEC 2023. Code editions and local amendments vary by jurisdiction. Always confirm against your adopted code book and your licensing board's published exam outline before test day.

A program is a precise sequence of instructions — like a work order a very fast, very literal apprentice executes exactly as written. Three structures cover most of it: variables store values (a voltage reading, a running total), conditionals branch (IF the reading exceeds 3% THEN flag it), and loops repeat (FOR every circuit in the panel, compute its load).

The connection to Unit B.5 is direct: conditionals are Boolean logic in action. `if (hot && !neutral)` is an AND gate with a NOT — the same algebra, executed by code instead of copper.

For someone in the trades, programming is leverage: a 20-line script can compute voltage drop for 500 circuits, generate a panel schedule, or log meter readings — FreeTradeCamp's own Formula Lab is nothing more than these three structures wearing a nice interface.

Go deeper: Harvard's CS50 — the gold-standard free introduction to programming — Semester 2 of the Go Deeper pathway.

Variable
Named stored value
Conditional
IF … THEN branch
Loop
Repeat over a set
Knowledge check

Quiz — 3 questions

1. To apply the same voltage-drop calculation to 200 circuits, a program uses a:

2. `if (currentA > 20) trip()` is the software equivalent of:

3. The Boolean expression `A && !B` reads:

← SyllabusNext: Probability, statistics, and measurement →