Lab Assignment 1
CS202, Summer 2004
1.(5pt) Modify Grades.java such that it uses ConsoleReader instead of JOptionPane for input.
2.(5pt) Write a program which reads an integer number consisting of only
0's and 1's, computes and outputs the binary, octal, and hexadecimal
values of the number. For example, if the input number is 101, the
binary, octal, and hexadecimal values are 5, 65, and 257, respectively.
Use ConsoleReader for input.
3.(5pt) Write a program which does the following:
- create three 2-dimensional arrays a, b, and c, where the size of each array is 8 by 8, the elements of a and b are random integers between 10 and 20, and each element c[i][j] of c is the sum of a[i][j] and b[i][j].
- implement a method print2DArray which takes a 2-dimensional integer array as parameter and prints out the elements in the array.
- output a, b, and c using the print2DArray method.