◄QuickSCREEN► ◄Details► ◄Example► ◄Contents► ◄Index► ────────────────────────────────────────────────────────────────────────────── INPUT # Statement Programming Example This example reads a series of test scores from a sequential file and calculates the average score. ' NOTE: Before you run this program, create a one-line data file ' CLASS.DAT made up of a series of test scores -- 97 84 63 89 100. DEFINT A-Z CLS ' Clear screen OPEN "class.dat" FOR INPUT AS #1 DO WHILE NOT EOF(1) Count = Count + 1 INPUT #1, Score Total = Total + Score PRINT Count; Score LOOP PRINT PRINT "Total students:";Count;" Average score:";Total / Count END Sample Output 1 97 2 84 3 63 4 89 5 100 Total students: 5 Average score: 86.6