Exercise 1 ----------- Initial value of a is 77 Initial value of aGlobal is 1 Value of a in swapInts is 55 Value of aGlobal in swapInts is 55 Final value of a is 77 Final value of aGlobal is 55 Initial value of o1.a is: 1 Value of o1.a in swapObjects is 0 Final value of o1.a 0 Final value of o2.a 1 * Each correct answer is worth 1pts * -2 pts if only numbers are written * -1 pts if some text is missing Exercise 2 ----------- correct return type (void) [2pts] correct initialization for sumOdd (1) [2pts] correct instruction in "if" condition (a[i]) [2pts] correct instruction in "if" statement (a[i]) [2pts] correct instruction in "else" statement (+=) [2pts] Correct program: public static void oddEven(int n){ int sumEven=0; int sumOdd=0; int[] a = new int[n]; for (int i=0; i9){ System.exit(0); } this.n=n; Block C: [2pts] this.n=n.n; Block D: [1pts] return this.n; Block E: [2pts] return this.n == n.n; Block F: [1pts] return this.n>n.n; Block G: [3pts] return this.n+""; Block H: [1pts] private Number n1; private Number n2; Block I: [2pts] super(); this.n1= new Number(); this.n2= new Number(); Block J: [1pts] super(); this.n1= n1; this.n2= n2; Block K: [2pts] return this.n1.equals(n.n1) && this.n2.equals(n.n2); Block L: [3pts] return this.n1.compare(n.n1) || (this.n1.equals(n.n1) && this.n2.compare(n.n2)); Block M: [2pts] return n1.toString()+n2.toString(); Block N: [1pts] private Number n1; private TwoDigitNumber n2; Block O: [1pts] super(); this.n1 = n1; this.n2 = n2; Block P: [2pts] return this.n1.equals(n.n1) && this.n2.equals(n.n2); Block Q: [3pts] return this.n1.compare(n.n1) || (this.n1.equals(n.n1) && this.n2.compare(n.n2)); Block R: [2pts] return n1.toString()+n2.toString(); Note: Call to super() is not required, but nice to have Exercise 5 ----------- a) 10 pts public static Number[] genNums(){ Number[] nums = new Number[100]; int n; for(int i=0; i<100; i++) { n = randonInt(100); if (n>=0 && n<10){ nums[i] = new Number(n); } else { nums[i] = new TwoDigitNumber(getFirstDigit(n), getSecondDigit(n)); } } return nums; } b) 10pts public static String printMax(ThreeDigitNumbers[] nums){ if (nums.length==0) { return "Empty array"; } else { ThreeDigitNumbers max = nums[0]; for (int i=0;i