import java.util.Scanner;

class Mar21 {
	public static void main(String[] args) {
/*
		int[][] matrix = new int[10][10];

		System.out.println("Enter 100 integers");

		Scanner kb = new Scanner(System.in);
		for(int i = 0; i < matrix.length; i++) {
			for(int j = 0; j < matrix[i].length; j++) {
				matrix[i][j] = kb.nextInt();
			}
		}

		for(int i = 0; i < matrix.length; i++) {
			for(int j = 0; j < matrix[i].length; j++) {
				System.out.printf("%3d ", matrix[i][j]);
			}
			System.out.println();
		}	
*/
		// Test prep

		// how to call method that has void return type
		foo();

		// how to call method that returns a value
		int value = return3000();
		System.out.printf("value: %d\n", value);
		
		// how to pass data into method
		int dbl = doubleIt(23);
		System.out.printf("dbl: %d\n", dbl);

		// declare 1D arrays
		char[] name = new char[10];
		int[] scores = { 90, 88, 93, 100, 100 };

		System.out.print("[");
		for(int i = 0; i < name.length; i++) {
			System.out.printf("%c", name[i]);
		}
		System.out.println("]");
		System.out.printf("ascii value: %d\n", (int) name[0]);
		
		Scanner kb = new Scanner(System.in);
		System.out.println("enter 10 chars separated by spaces");
		for(int i = 0; i < name.length; i++) {
			name[i] = kb.next().charAt(0);
		}
		for(int i = 0; i < name.length; i++) {
			System.out.printf("%c ", name[i]);
		}
		System.out.println();

		// Declare 3x3 array - print sum of each row and max sum of all rows

		int[][] matrix = { { -1, -2, -3}, { -4,-5 ,-6}, {-1, -2, -3}}; 
	
		int sum = 0;
		int max = Integer.MIN_VALUE;
		for(int i = 0; i < matrix.length; i++){
			for(int j = 0; j < matrix[i].length; j++) {
				sum += matrix[i][j];
				
			}
			System.out.printf("sum: %d\n", sum);

			if (sum > max) {
				max = sum;
			}
			sum = 0;
		}
		System.out.printf("max sum: %d\n", max);

	}

		static void foo() {
			System.out.println("Foo");
		}
		
		static int return3000() {
			return 3000;
		}

		static int doubleIt(int x) {
			return (2 * x);
		}
}
