|
|
Creating Subroutines – Sample AssignmentA program is required to calculate the average of four mid-term marks for a secondary school student. The average should include decimals; the four marks are integers. Describe a subroutine that could be used to calculate the average. Identify the parameters, subroutine task, and return value. List local and global variables and indicate how they would match up between the subroutine and main program.
Source: Public and Catholic District School Board Writing Partnership, Course Profile: Computer and Information Science, Grade 11, University/College Preparation ICS3U, Queen’s Printer for Ontario, 2001, adapted.
|
| ||||