' PHONEFIX.BAS
' This program uses two fixed-length string arrays to record names and
'   telephone numbers.

OPTION BASE 1                         ' set lower bound of array to 1

CLS
                                      ' get number of names
INPUT "How many names would you like to enter?  ", names%
PRINT

DIM fullNames(names%) AS STRING * 18  ' 18 characters each for names
DIM phones(names%) AS STRING * 14     ' 14 characters each for phones

FOR i% = 1 TO names%                  ' read values into both arrays
    INPUT "Enter name:  ", fullNames(i%)
    INPUT "Enter phone number:  ", phones(i%)
    PRINT
NEXT i%

PRINT "Name                Phone"
PRINT "------------------------------------"

FOR i% = 1 TO names%                  ' print contents of both arrays
    PRINT fullNames(i%); "  "; phones(i%)
NEXT i%

