COM1204 Object-Oriented Design -- Quiz 1 -- Thursday, June 28th

Summer 2001 -- Professor Futrelle
College of Computer Science, Northeastern U., Boston, MA


PRINT your name clearly ________________________________________________ Your ID no. ________________


In the following two questions, there is no need to copy the two function definitions, just write the specification text itself.

Question 1.

Write the specifications (REQUIRES, MODIFIES and EFFECTS) for the following function.

        public static int funOne(int[] arr) {

            for(int i = 1; i < arr.length; i++) {
                arr[i]++ ;
            }
            
            return arr[10];
            
        } // funOne()

Question 2.

Write the specifications (REQUIRES, MODIFIES and EFFECTS) for the following function. Assume that the variable var is a private instance variable of the class in which this method is defined.

        public void funTwo(int a, int b) {

			var = Math.min(a,b);
			
        } // funTwo()

Answers here: