hts.StevenWood.com

Labs 2

Home ] Up ] How to use Methods in Java ] Methods and Parameters in Java ] Creating User-Defined Methods ] Common Programming Errors ] Good Programming Practices ] Lab Exercises ] Labs 1 ] [ Labs 2 ] Rubric ][ Last Page ]

Creating Subroutines – Sample Assignment

A 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.

 

Home ] Up ] How to use Methods in Java ] Methods and Parameters in Java ] Creating User-Defined Methods ] Common Programming Errors ] Good Programming Practices ] Lab Exercises ] Labs 1 ] [ Labs 2 ] Rubric ][Last Page]
All material on this site is copyright © 1997- by Steven Wood or as credited. All right reserved. Use of this site indicates you agreement with the  terms of use.
Send comments or questions to about this page.
Every attempt has been made to credit work under copyright. If there are any claims that copyright has been missed please contact the .
+SDG+