Ok so I have a program to read three exam scores from 6 students. I have to make the program average the 3 exam scores for each student and then have an average for each invidual exam. Then have a total average for every score there.

Blah I can't get it to work and I have been sitting here trying to figure it out for along time. Here's the code so far. And its alot.

``````'John Stonebraker

' Program to compute average of the exams

'    Variables Used

' Nam\$       Name of worker
' Exam1      Score on exams
' Exam2      "         "
' Exam3      "         "
' Average
' Average1
' Average2
' Average3
' AverageFinal
' AverageFinal1
' AverageExam1
' AverageExam2
' AverageExam3
' T1\$, H1\$, D1\$, H2\$, TL\$, TL1\$, TL2\$

'Program Mainline***********************************************************

CLS
GOSUB InitializeImages
GOSUB ProcessDetail
GOSUB PrintTotals
END

'Initialize Images**********************************************************

InitializeImages:
LET T1\$ = "                            Scores"
LET H1\$ = "StudentName           Exam 1   Exam 2   Exam 3    Average"
LET D1\$ = "\               \        \   \    \   \    \   \     \    \"
LET TL\$ = "Class Average         Exam 1   Exam 2   Exam 3"
LET TL1\$ = "                         \   \    \    \   \    \"
LET TL2\$ = "Average of all scores-  \    \"
RETURN

PRINT
PRINT T1\$
PRINT
PRINT H1\$
PRINT
PRINT
RETURN

'Process Detail*************************************************************

ProcessDetail:
DO UNTIL UCASE\$(Nam\$) = "END"
GOSUB PrintDetail
LOOP
RETURN

DATA Jo Smith, 70, 80, 90
DATA Ed Lynn, 40, 65, 59
DATA Richard Johnson, 86, 93, 72
DATA Linda Harris, 95, 75, 86
DATA Wendy Williams, 77, 83, 78
DATA David Rudolph, 55, 83, 78
DATA END, 0, 0, 0
RETURN

IF Exam1 < 60 THEN
END IF
IF Exam1 >= 60 AND Exam1 <= 69 THEN
END IF
IF Exam1 >= 70 AND Exam1 <= 79 THEN
END IF
IF Exam1 >= 80 AND Exam1 <= 89 THEN
END IF
IF Exam1 >= 90 THEN
END IF

IF Exam2 < 60 THEN
END IF
IF Exam2 >= 60 AND Exam2 <= 69 THEN
END IF
IF Exam2 >= 70 AND Exam2 <= 79 THEN
END IF
IF Exam2 >= 80 AND Exam2 <= 89 THEN
END IF
IF Exam2 >= 90 THEN
END IF

IF Exam3 < 60 THEN
END IF
IF Exam3 >= 60 AND Exam3 <= 69 THEN
END IF
IF Exam3 >= 70 AND Exam3 <= 79 THEN
END IF
IF Exam3 >= 80 AND Exam3 <= 89 THEN
END IF
IF Exam3 >= 90 THEN
END IF

LET Average = Exam1 + Exam2 + Exam3 / 3

IF Average < 60 THEN
END IF
IF Average >= 60 AND Average <= 69 THEN
END IF
IF Average >= 70 AND Average <= 79 THEN
END IF
IF Average >= 80 AND Average <= 89 THEN
END IF
IF Average >= 90 THEN
END IF

LET AverageExam1 = AverageExam1 + Exam1
LET Average1 = AverageExam1 / 6

IF Average1 < 60 THEN
END IF
IF Average1 >= 60 AND Average1 <= 69 THEN
END IF
IF Average1 >= 70 AND Average1 <= 79 THEN
END IF
IF Average1 >= 80 AND Average1 <= 89 THEN
END IF
IF Average1 >= 90 THEN
END IF

LET AverageExam2 = AverageExam2 + Exam2
LET Average2 = AverageExam2 / 6

IF Average2 < 60 THEN
END IF
IF Average2 >= 60 AND Average2 <= 69 THEN
END IF
IF Average2 >= 70 AND Average2 <= 79 THEN
END IF
IF Average2 >= 80 AND Average2 <= 89 THEN
END IF
IF AverageExam2 >= 90 THEN
END IF

LET AverageExam3 = AverageExam3 + Exam3
LET Average3 = AverageExam3 / 6

IF Average3 < 60 THEN
END IF
IF Average3 >= 60 AND Average3 <= 69 THEN
END IF
IF Average3 >= 70 AND Average3 <= 79 THEN
END IF
IF Average3 >= 80 AND Average3 <= 89 THEN
END IF
IF Average3 >= 90 THEN
END IF

LET AverageFinal = AverageFinal + AverageExam1 + AverageExam2 + AverageExam3
LET AverageFinal1 = AverageFinal1 / 18

IF AverageFinal1 < 60 THEN
END IF
IF AverageFinal1 >= 60 AND AverageFinal1 <= 69 THEN
END IF
IF AverageFinal1 >= 70 AND AverageFinal1 <= 79 THEN
END IF
IF AverageFinal1 >= 80 AND AverageFinal1 <= 89 THEN
END IF
IF AverageFinal1 >= 90 THEN
END IF

RETURN

'Print Detail**************************************************************

PrintDetail:
RETURN
'Print Totals**************************************************************

PrintTotals:
PRINT
PRINT TL\$
PRINT

'End of Program************************************************************``````

I don't know how to print out the output screen but so far I can't get the averages of each student correct, average of each individual exam, and a average of every single score from each exam. The problem has to be with the Ifs and Thens.

Any help would be appreciated. ;)

Ok My buddy helped with with alittle bit so far.

Here's the new code:

``````'John Stonebraker

' Program to compute average of the exams

'    Variables Used

' Nam\$       Name of worker
' Exam1      Score on exams
' Exam2      "         "
' Exam3      "         "
' Average
' Average1
' Average2
' Average3
' AverageFinal
' AverageFinal1
' AverageExam1
' AverageExam2
' AverageExam3
' T1\$, H1\$, D1\$, H2\$, TL\$, TL1\$, TL2\$

'Program Mainline***********************************************************

CLS
GOSUB InitializeImages
GOSUB ProcessDetail
GOSUB PrintTotals
END

'Initialize Images**********************************************************

InitializeImages:
LET T1\$ = "                            Scores"
LET H1\$ = "StudentName           Exam 1   Exam 2   Exam 3    Average"
LET D1\$ = "\               \        \   \    \   \    \   \     \    \"
LET TL\$ = "Class Average         Exam 1   Exam 2   Exam 3"
LET TL1\$ = "                         \   \    \    \   \    \"
LET TL2\$ = "Average of all scores -  \    \"
RETURN

PRINT
PRINT T1\$
PRINT
PRINT H1\$
PRINT
PRINT
RETURN

'Process Detail*************************************************************

ProcessDetail:
DO UNTIL UCASE\$(Nam\$) = "END"
GOSUB PrintDetail
LOOP
RETURN

DATA Jo Smith, 70, 80, 90
DATA Ed Lynn, 40, 65, 59
DATA Richard Johnson, 86, 93, 72
DATA Linda Harris, 95, 75, 86
DATA Wendy Williams, 77, 83, 78
DATA David Rudolph, 55, 83, 78
DATA END, 0, 0, 0
RETURN

IF Exam1 < 60 THEN
END IF
IF Exam1 >= 60 AND Exam1 <= 69 THEN
END IF
IF Exam1 >= 70 AND Exam1 <= 79 THEN
END IF
IF Exam1 >= 80 AND Exam1 <= 89 THEN
END IF
IF Exam1 >= 90 THEN
END IF

IF Exam2 < 60 THEN
END IF
IF Exam2 >= 60 AND Exam2 <= 69 THEN
END IF
IF Exam2 >= 70 AND Exam2 <= 79 THEN
END IF
IF Exam2 >= 80 AND Exam2 <= 89 THEN
END IF
IF Exam2 >= 90 THEN
END IF

IF Exam3 < 60 THEN
END IF
IF Exam3 >= 60 AND Exam3 <= 69 THEN
END IF
IF Exam3 >= 70 AND Exam3 <= 79 THEN
END IF
IF Exam3 >= 80 AND Exam3 <= 89 THEN
END IF
IF Exam3 >= 90 THEN
END IF

LET Average = (Exam1 + Exam2 + Exam3) / 3

IF Average < 60 THEN
END IF
IF Average >= 60 AND Average <= 69 THEN
END IF
IF Average >= 70 AND Average <= 79 THEN
END IF
IF Average >= 80 AND Average <= 89 THEN
END IF
IF Average >= 90 THEN
END IF

LET AverageExam1 = AverageExam1 + Exam1
LET Average1 = AverageExam1 / 6

IF Average1 < 60 THEN
END IF
IF Average1 >= 60 AND Average1 <= 69 THEN
END IF
IF Average1 >= 70 AND Average1 <= 79 THEN
END IF
IF Average1 >= 80 AND Average1 <= 89 THEN
END IF
IF Average1 >= 90 THEN
END IF

LET AverageExam2 = AverageExam2 + Exam2
LET Average2 = AverageExam2 / 6

IF Average2 < 60 THEN
END IF
IF Average2 >= 60 AND Average2 <= 69 THEN
END IF
IF Average2 >= 70 AND Average2 <= 79 THEN
END IF
IF Average2 >= 80 AND Average2 <= 89 THEN
END IF
IF Average2 >= 90 THEN
END IF

LET AverageExam3 = AverageExam3 + Exam3
LET Average3 = AverageExam3 / 6

IF Average3 < 60 THEN
END IF
IF Average3 >= 60 AND Average3 <= 69 THEN
END IF
IF Average3 >= 70 AND Average3 <= 79 THEN
END IF
IF Average3 >= 80 AND Average3 <= 89 THEN
END IF
IF Average3 >= 90 THEN
END IF

LET AverageFinal1 = (Average1 + Average2 + Average3) / 3

IF AverageFinal1 < 60 THEN
END IF
IF AverageFinal1 >= 60 AND AverageFinal1 <= 69 THEN
END IF
IF AverageFinal1 >= 70 AND AverageFinal1 <= 79 THEN
END IF
IF AverageFinal1 >= 80 AND AverageFinal1 <= 89 THEN
END IF
IF AverageFinal1 >= 90 THEN
END IF

RETURN

'Print Detail**************************************************************

PrintDetail:
RETURN
'Print Totals**************************************************************

PrintTotals:
PRINT
PRINT TL\$