//Name: Carlos Manuel Torres Jr. //Section: 6769 //Group : 8 //Partner: Brian Frost class FilledSquare { public static void main(String args[]) { int row, col; printFilledSquare(5,5); printFilledSquare(); } public static void printFilledSquare(int row, int col) { int i, j; for(i = 1; i <= row; i++) { System.out.println(); for(j = 1; j <= col; j++) { System.out.print(i + " "); } } System.out.println(); } public static void printFilledSquare() { int row, col; System.out.print("Enter the number of rows: "); row = UserInput.readInt(); System.out.print("Enter the number of columns: "); col = UserInput.readInt(); for(int i = 1; i <= row; i++) { System.out.println(); for(int j = 1; j <= col; j++) { System.out.print(i + " "); } } } } class Digits { public static void main(String args[]) { boolean test = true; int userValue, z, digits = 0; int array[]; System.out.print("Enter an integer value: "); userValue = UserInput.readInt(); z = userValue; while(test) { userValue = (userValue / 10); if(userValue == 0) { test = false; } digits++; } array = new int[digits]; parseDigits(z, array); printDigits(array); } public static int [] parseDigits(int z, int x[]) { int j; for(j = 0; j < x.length; j++) { x[j] = z % 10; z = (z / 10); } System.out.println(""); return x; } public static void printDigits(int [] array) { int i; for(i = 0; i < array.length; i++) { System.out.println(array[i]); } } } class Shift { public static void main(String args[]) { char data[] = new char[10]; int array; init(data); shiftBack(data); } public static void init(char data[]) { int i; for(i = 0; i < data.length; i++) { if(i % 3 == 0) { data[i] = '*'; } else if(i % 3 == 1) { data[i] = '#'; } else if(i % 3 == 2) { data[i] = '$'; } } } public static void shiftBack(char [] data) { int i; for(i = 0; i < data.length -1; i++) { data[i] = data[i + 1]; // shift n+1 to n, back one for every n } data[9] = '&'; // last position in array set to ampersand } }