University of Iowa Computer Science Department

Quiz 02


1. Write a method called Square that takes one integer parameter named number. The method should return the square of its argument. Explain whether your method will be called-by-value or called-by-reference and why.

2. Write a program fragrment that will print the string "Over 100" if the value in the integer variable "number" is greater than 100. If number contains a value less than or equal to 100, print the string "Less than or equal to 100."

CLAS CRA ACM | ©2005 The University of Iowa | Modified: February 04, 2005, 10:25:01.