' chapter 7 example program ' sum and average of 4 grades ' grades are from 0-100 dim grade0 as int ' we’ll discuss the Dim command in the next chapter dim grade1 as int ' here are our 4 grades dim grade2 as int dim grade3 as int dim sum as int 'this variable will store the sum of the 4 grades dim avg as int 'this variable will store the average of the 4 grades ' ---INPUT --- print "Enter grade 0" 'we’ll discuss numbering at 0 in the next chapter input grade0 'get the grades from the student print "Enter grade 1" input grade1 print "Enter grade 2" input grade2 print "Enter grade 3" input grade3 '--- PROCESS --- ' compute the sum and the average sum = grade0+grade1+grade2+grade3 avg = sum/4 '--- OUTPUT --- print "The average of your " print "4 grades is", avg print "Press to continue" dim tmp as int' a temporary variable input tmp 'wait for the user to press enter