The following is a list of salaries of the six employees in a certain company:

Name Salary
T. Angel $43,000
F. Smith $31,000
K. Johnston $22,000
P. Miner $18,000
C. Altman $27,000
A. Lu $19,000

Read a single dimension array for name and another array for Salary. Calculate and output the average salary for the company as well as the names of all people whose salaries exceed the average.

How would I write this program?

Maybe something like this?

DIM EmployeeNam(1 TO 16), Salary(1 TO 6)

GOSUB InitializeVariables
GOSUB LoadTables
CLS
GOSUB PrintDetail
GOSUB PrintSubtotals
GOSUB PrintTotals
END

InitializeVariables:
LET PageCt = 0
LET Salary = 0
LET T1$ = " Salary for employees ##"
LET H1$ = ""
LET H2$ = " Name Salary "
LET D1$ = " \ / $###.## "
LET ST$ = " \ \ SUBTOTAL #"
LET TL$ = " TOTAL #"
LET MaxLines = 30
RETURN

'******************************
' Read numbers into the array
' *****************************

LoadTables:
FOR N = 1 TO 6
READ EmployeeNam(N), Salary(N)
LET AvgSalary = Salary + Salary(N)
NEXT N

DATA T. Angel, 43,000
DATA F. Smith, 31,000
DATA K. Johnston,22,000
DATA P. Miner, 18,000
DATA C. Altman, 27,000
DATA A. Lu, 19,000
DATA 0,0,0
DATA END
RETURN

PrintDetail:
PRINT H2$
FOR N = 1 TO 6
PRINT USING D1$; EmployeeNam(N); Salary(N); 'Print details
NEXT N
RETURN

PrintSubtotals:
LET AvgIncome = Salary / 6 'Calc average income
RETURN

PrintTotals:
PRINT USING "$##,###.## \ \"; AvgSalary; "is the average Salary"
GOSUB PrintAboveAverage
RETURN

PrintAboveAverage:
PRINT H2$
FOR N = 1 TO 6
IF Salary(N) > AvgSalary THEN
PRINT USING D1$; EmployeeNam(N); Salary(N)
END IF
NEXT N
RETURN

Can someone please help me

Looks like you have a good start. Have you tried actually running it?

Yes, It doesnt print anything to the output screen and I get a syntax error on the READ line....

READ EmployeeNam(N), Salary(N)

Certainly! I can help you with writing the program. Here's the modified version of the code that should achieve what you're looking for:

```python
DIM EmployeeNam$(1 TO 6)
Salary(1 TO 6)

CLS

GOSUB LoadTables
GOSUB PrintDetail
GOSUB CalculateAverageSalary
GOSUB PrintAboveAverage

END

LoadTables:
FOR N = 1 TO 6
READ EmployeeNam$(N), Salary(N)
NEXT N
RETURN

PrintDetail:
PRINT "Name Salary"
FOR N = 1 TO 6
PRINT EmployeeNam$(N); " "; "$"; Salary(N)
NEXT N
PRINT
RETURN

CalculateAverageSalary:
TotalSalary = 0
FOR N = 1 TO 6
TotalSalary = TotalSalary + Salary(N)
NEXT N
AvgSalary = TotalSalary / 6
PRINT "Average Salary: $"; AvgSalary
PRINT
RETURN

PrintAboveAverage:
PRINT "People with salaries above average:"
FOR N = 1 TO 6
IF Salary(N) > AvgSalary THEN
PRINT EmployeeNam$(N)
END IF
NEXT N
RETURN

DATA "T. Angel", 43000
DATA "F. Smith", 31000
DATA "K. Johnston", 22000
DATA "P. Miner", 18000
DATA "C. Altman", 27000
DATA "A. Lu", 19000
```

This modified version of the code removes unnecessary variables and adds missing parts in order to calculate the average salary and print the names of employees whose salaries exceed the average.