# # Author: James Tam # Version: March 16, 2008 # # The first version of a program that tracks the grades for a class. # (This version employs an inappropriate implementation and is used only # for illustration purposes only - what could be done with an array/list). # Global constant CLASS_SIZE = 5 # Variable initializations stu1 = 0 stu2 = 0 stu3 = 0 stu4 = 0 stu5 = 0 total = 0 average = 0 stu1 = input ("Enter grade for student no. 1: ") stu2 = input ("Enter grade for student no. 2: ") stu3 = input ("Enter grade for student no. 3: ") stu4 = input ("Enter grade for student no. 4: ") stu5 = input ("Enter grade for student no. 5: ") total = stu1 + stu2 + stu3 + stu4 + stu5 average = total / CLASS_SIZE print print "GRADES" print "The average grade is", average, "%" print "Student no. 1:", stu1 print "Student no. 2:", stu2 print "Student no. 3:", stu3 print "Student no. 4:", stu4 print "Student no. 5:", stu5