Checkbook

Date: 198x
Type: Program
Platform(s): TS 2068
Tags: Finance, Home

This program helps users reconcile a bank statement with their checkbook by calculating an adjusted balance and correction figure. It accepts a starting bank balance, then collects outstanding check numbers and amounts in a loop (terminated by entering zero as the check number), followed by outstanding deposit amounts (terminated by entering zero). The program computes a new balance by subtracting total checks and adding total deposits, then compares it against the user’s recorded checkbook balance to produce a correction value. All inputs and results are echoed to both the screen via PRINT and a printer via LPRINT, producing a permanent paper record of the reconciliation.


Program Analysis

Program Structure

The program is divided into five logical phases, all written in straightforward sequential BASIC with two input loops:

  1. Header & setup (lines 100–180): Prints titles to screen and printer, then prompts for the statement date and opening bank balance.
  2. Check entry loop (lines 190–240): Repeatedly inputs a check number and amount, accumulating a running total in CTOTAL. A zero check number exits the loop via IF CHECK=0 THEN GO TO 250.
  3. Deposit entry loop (lines 310–350): Similarly accumulates deposit amounts in DTOTAL, exiting when a zero amount is entered.
  4. Balance calculation (lines 360–395): Computes NBAL = BALANCE - CTOTAL + DTOTAL, prompts for the user’s own checkbook balance (CBAL), and prints the discrepancy.
  5. Termination (line 400): Prints “END”.

Dual Output Strategy

Every significant data item is sent to both the screen with PRINT and the printer with LPRINT. Each INPUT statement is immediately followed by a PRINT of the variable to make the entered value visible on screen, since INPUT on this platform does not automatically leave the value displayed after the prompt line is cleared. The LPRINT lines create a permanent paper ledger of the reconciliation session.

Key Variables

VariablePurpose
D$Statement date string
BALANCEOpening bank balance from statement
CHECKCurrent check number (0 to terminate loop)
AMTAmount of current outstanding check
CTOTALRunning total of all outstanding checks
DAMTAmount of current outstanding deposit
DTOTALRunning total of all outstanding deposits
NBALComputed adjusted new balance
CBALUser’s own checkbook register balance

Notable Techniques and Idioms

  • The sentinel-value loop pattern (enter 0 to stop) is used for both the check and deposit entry phases, a common technique when the number of entries is unknown in advance.
  • The check loop (lines 200–240) requests the check number first; if it is zero the amount prompt is skipped entirely, avoiding an extraneous LPRINT of a dummy amount.
  • The deposit loop (lines 320–350) uses the deposit amount itself as the sentinel, meaning a zero deposit terminates the loop without being added to DTOTAL. This is slightly asymmetric with the check loop but functionally correct.
  • Inline PRINT of entered values after INPUT (e.g., line 200: INPUT CHECK: PRINT CHECK) is a necessary workaround to keep entered data visible on screen.

Potential Anomalies

  • The check loop prints the check number to the printer (line 205) before checking whether it is zero (line 210). This means when the user enters 0 to terminate, the value “0” is still sent to the printer as a spurious “CHECK NUMBER. 0” line before the program moves on.
  • There is no input validation; entering a negative amount for a check or deposit would silently corrupt the totals.
  • The program has no mechanism to correct a mis-entered value; an error requires restarting from the beginning.
  • Floating-point arithmetic may produce small rounding errors in the correction figure when amounts involve cents, a common limitation of BASIC numeric storage on this platform.

Content

Appears On

One of a series of library tapes. Programs on these tapes were renamed to a number series. This tape contained

Related Products

Related Articles

Related Content

Image Gallery

Checkbook

Source Code

  100 REM PROGRAM *"CHECKBOOK"*
  101 PRINT "       *STATEMENT OF ACCOUNT*"       
  102 LPRINT "STATEMENT OF ACCOUNT"
  105 PRINT "STATEMENT DATE   ": INPUT D$: PRINT D$
  110 LPRINT "STATEMENT DATE    ";D$
  120 PRINT "ENTER BANK BALANCE    ";: INPUT BALANCE: PRINT BALANCE
  125 LPRINT "BANK BALANCE    ";BALANCE
  130 PRINT "ENTER EACH OUTSTANDING"
  140 PRINT "CHECK NUMBER AND AMOUNT."
  150 PRINT 
  160 PRINT "ENTER A ZERO FOR THE"
  170 PRINT "CHECK NUMBER WHEN FINISHED."
  180 PRINT 
  190 LET CTOTAL=0
  200 PRINT "ENTER CHECK NUMBER    ";: INPUT CHECK: PRINT CHECK
  205 LPRINT "CHECK NUMBER.  ";CHECK
  210 IF CHECK=0 THEN GO TO 250
  220 PRINT "ENTER CHECK AMOUNT    ";: INPUT AMT: PRINT AMT
  225 LPRINT "CHECK AMOUNT ";AMT
  230 LET CTOTAL=CTOTAL+AMT
  240 GO TO 200
  250 PRINT "ENTER EACH OUTSTANDING"
  260 PRINT "DEPOSIT AMOUNT."    
  270 PRINT 
  280 PRINT "ENTER A ZERO AMOUNT"
  290 PRINT "WHEN FINISHED."
  300 PRINT 
  310 LET DTOTAL=0
  320 PRINT "DEPOSIT AMOUNT     ";: INPUT DAMT: PRINT DAMT
  325 LPRINT "DEPOSIT AMOUNT   ";DAMT
  330 IF DAMT=0 THEN GO TO 360
  340 LET DTOTAL=DTOTAL+DAMT
  350 GO TO 320
  360 LET NBAL=BALANCE-CTOTAL+DTOTAL
  365 LPRINT "NEW BALANCE    ";NBAL
  370 PRINT "NEW BALANCE= ";NBAL
  380 PRINT "CHECKBOOK BALANCE   ";: INPUT CBAL: PRINT CBAL
  385 LPRINT "CHECKBOOK BALANCE    ";CBAL
  390 PRINT "CORRECTION= ";NBAL-CBAL
  395 LPRINT "CORRECTION=    ";NBAL-CBAL
  400 PRINT "END"

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

People

No people associated with this content.

Scroll to Top