Lecture 1

August 29, 2017

Homework

What println statements will generate the following output?

This program prints a
quote from the Gettysburg Address.

"Four score and seven years ago,
our 'fore fathers' brought forth on
this continent a new nation."

What println statements will generate the following output?

A "quoted" String is
'much' better if you learn
the rules of "escape sequences."

Also, "" represents an empty String.
Don't forget: use \" instead of " !
'' is not the same as "

Lecture 2

August 31, 2017

Lab 1

Lab 2

Lecture 3

September 7, 2017

Homework

Write a for-loop that will produce the following output:

System.out.println("1 squared = " + 1 * 1);
System.out.println("2 squared = " + 2 * 2);
System.out.println("3 squared = " + 3 * 3);
System.out.println("4 squared = " + 4 * 4);
System.out.println("5 squared = " + 5 * 5);
System.out.println("6 squared = " + 6 * 6);

Lab 3

Lecture 4

September 14, 2017

Lab 4

Lecture 4b

September 19, 2017

Lecture 5

Homework

Write the following methods (the first two are required and collected on Tuesday). Follow the template:

public static /* <<return type>> */ methodName ( /* <<parameters>> */ ) {
    /* code goes here */
    return /* return value */;
}

Lecture 6

September 26, 2017

Midterm Examination 1 Review

Midterm Exam #1

September 28, 2017

Lecture 7

October 5, 2017

Lab 5

Lecture 8

October 12, 2017

Lab 6

Lecture 9 (in Lab)

October 17, 2017

Lecture 10

October 19, 2017

Receipt,java

SnoopName.java

Lab 7

October 24, 2017

Lecture 11

October 26, 2017

DrawingPanel.java

DrawBob.java

Lab 8

October 31, 2017

Lecture 12

November 2, 2017

November 7, 2017

public static boolean ends(String s1, String s2) {
    return s1.length() >= 2 && s2.length() >= 2 && s1.endsWith(s2.substring(s2.length() - 2));
}

public static boolean pickSeven(Random r) {
    for (int i = 0; i < 10; i++) {
        int number = r.nextInt(30) + 1;
        System.out.print(number + " ");
        if (number == 7) {
            return true;
        }
    }
    return false;
}

public static int sumDigits(int number) {
    int sum = 0;
    while (number != 0) {
        int digit = number % 10;
        sum += digit;
        number /= 10;
    }
    return sum;
}

Exam 2

November 9, 2017

Lab 9

Lecture 13

Guest Lecture by Dr. Zoppetti

File Processing Part 1

File Processing Part 2

November 16, 2017

Lab 10

November 21, 2017

November 28, 2017

Lecture 14

November 30, 2017

Lab 11

December 5, 2017

Lecture 15

December 7, 2017

Final Review Sheet

Policy for Responsible Use

Code Samples