[next] [previous] [contents]

  RECORD Grade_record
      STRING Student_name = 30
      INTEGER Quiz_scores (1 TO 10) ! Array to hold ten quiz grades.
  END RECORD
  ! Declarations
  DECLARE Grade_record Student_grades ( 5 )
  !The Student_grades array holds information on six students
  !(0 through 5), each of whom has ten quiz grades (1 through 10).
  DECLARE INTEGER I,J
  !Program logic starts here.
  FOR I = 0 TO 5 !This loop executes once for each student.
      PRINT
      INPUT 'Student name'; Student_grades(I)::Student_name
        FOR J = 1 TO 10 !This loop executes ten times for each student.
            PRINT 'Score for quiz number'; J
            INPUT Student_grades(I)::Quiz_scores(J)
        NEXT J
  NEXT I
  FOR I = 0 TO 5
      PRINT
      PRINT 'Student name: '; Student_grades(I)::Student_name
        FOR J = 1 TO 10
            PRINT 'Score for quiz number'; J; ": ";
            PRINT Student_grades(I)::Quiz_scores(J)
        NEXT J
  NEXT I
  END