I use JBuilder. It's old but is what we used at uni. Version 5 maybe. Maybe you could get that from some p2p fileshare or whatever. 16. (a) Implement the method public static char toLower(char c) { // Characters are just numbers - Look at the DEC column in http://www.lookuptables.com/asciifull.gif // You'll notice that the difference between 'a' and 'A', or 'b' and 'B' is always the same. // So first let's test if the char is an Uppercase character bool charIsUppercase = ( (c>='A') & (c<='Z') ); // If it is not uppercase, then there's no need to convert. (It could even be a symbol like '?') if( !charIsUppercase ) return c; // If we get here, it is uppercase. // So let's find out the 'difference' between a uppercase and a lowercase character int fromUpperToLower = 'a' - 'A'; // So add that value to our char to convert it to lower char convertedToLower = c + fromUpperToLower; // And return it return convertertedToLower; } 16. (b) Implement the method public static boolean isIdChar(char c) { // I think a Java identifier can only begin with 'a' to 'z' or 'A' to 'Z' if( (c>='A') & (c<='Z') ) // If it's an uppercase char, then it is valid return true; if( (c>='a') & (c<='z') ) // If it's a lowercase char, then it is also valid return true; return false; // If we get here, then it must be a symbol, and is therefore invalid } 17. Consider the method: public static void f(int[] arr, int item) { for(int i=0; i< arr.length; i++) if(arr[i]<0) arr[i] = item; } Assume the declaration: int[] intList = {-1, 5, 3, -77, -9}; (a) The contents of intList should remain the same. (b) The contents of intList should remain the same. This is because arrays are passed by 'value'. The function f() receives a 'copy' of the array intList. So when it makes a change to the arr[i], it will change arr[i] (the copy) but not the intList[i] (the original). BTW check it out for yourself just to be sure. 18. What is the output of the program? public class NumberSystems { public static void main(String[] args) { int[] binary = {1,0,1,1}; int[] octal = {5,4,0,1}; baseNumber(2,binary); baseNumber(8,octal); } public static void baseNumber(int b, int[] d) { int a[] = {1,b, b*b, b*b*b}; // Create a series in the base b e.g. 1,2,4,8 for(i = d.length-1; i >=0; i--) // Reverse through the array sum += d[i]*a[i]; // Multiply the input by the series System.out.println("The number " + d[3] + d[2] + d[1] + d[0] + " (base " + b + ") = " + sum); } } Output of the program: The number 1011 (base 2) = 11 The number 5401 (base 8) = 2817 PROGRAMMING EXERCISES 1. (a) Implement a method that takes a double parameter x and outputs whether x lies in the range between 0.0 <= x <= 1.0 void outputInRange(double x) { if( x>=0.0 & x<= 1.0 ) System.out.println("x lies in the range between 0.0 <= x <= 1.0"); else System.out.println("x does NOT lie in the range between 0.0 <= x <= 1.0"); } 1. (b) Write a main program that declares the array public static void main(String[] args) { double[] arr = {.897, 1.67, 9.89, -.279, .53, 1.0, 1.01, 0.0}; for(int i=0; i