Week1 b: Syllabus; Tutorial 1.1 - 1.4; 3.1 first round. Week2 a: Tutorial 1.5 - 1.9, review important concepts in section 2. b: Review 3.1; 3.2 Code style and command-line arguments; 3.3 Java package; Project: modify Hello1 to print a triangle of * Week3 a: Review 3.1 Java package, cover 3.4 Best practice and 3.5: Local variables, expressions, and assignment. b: 3.6 Basic built-in data types and type casting; Project: write a program that will print out the two roots of equation 2.0x^2 + 3.1x + 1.1 = 0. Week4 a: 3.7 Command-line arguments and loops; Project: write a program that will print out the sum of a variable number of integer or double values on the command-line. Use for loop, then use while loop. b: 3.8 Calculator with if-else statements; 3.9 Calculator with switch statement. Project: Write a program that accepts variable number of command-line integers and report back the max of them. (A loop with if statement in the loop body) Week5 a: Holiday b: Quiz 1 through Blackboard in the Lab G315. Week6 a: 3.10 Calculator with exceptin processing. 3.11 Conditionally interupting loops. 3.12 Arrays gets started (10 minutes, covered declarations of int[], int[][], and iint[][][]). b. Holiday Week7 a. Assignment 1 due. Working on programming exercises similar to the assignment. B. 3.12 Arrays. 3.13 Method declaration and invocation. Project: Write a Java class that 1) Declare an array, named data[], of integers with 10 cells; 2) Initialize data[i] = i * i; 3) Write a method "int inc(int x)" that returns the parameter value plus one; 4) With a loop, apply method inc(int) on each value in data[], and print the return value on separate lines. Week8 a. 3.14 Java documentation comments. 3.15 Scopes of local variables. 3.16 Formatting output. Projects: 1) Print the reversed sequence of command-line arguments. 2) Write a program that (a) accepts an integer as command-line argument; (b) creates an array holding integers {1, 3, 6, 9, 12, 25}; (c) prints -1 if the input integer is not in the array, or the index value of the input integer in the array if the array contains the integer. b. 3.17 Timing the evaluation of Pi. 3.18 Matrix multiplication. Project: Write a Java program that (a) creates a 4x4 int-typed array d[][]; (b) initializes d[i][j] to 4*i + j; (c) uses a two-level nested for-loops to find the total value in array d[][]; (d) prints out the total value. Week9 a. 3.19 Interactive command-line data input 3.20 Window-based data input/output b. Quiz 2 Week10 a. Review quiz 2 3.21 Text file input/output b. 3.22 Recursive vs. iterative methods: factorial 3.23 Recursive vs. iterative methods: Fibonacci numbers 3.24 Algorithm and Towers of Hanoi Week11 a. Introduction to classes and objects, constructors, instance variables, method toString(), setter, getter, constants (TestCircle.java). Start with an empty class Circle and printing its objects. Then add private instance variable radius and constant PI, overloaded constructors with two usages of "this", and customize method toString(). Then getter and setter methods are added. Assignment 3 (Matrix addition) specified. Due on Nov 29. Reading assignment: Liang textbook 6.1-6.5. b. Redo topics for the previous lecture in TestRational.java. Add business logic method findArea(). Project: Write a class Clock that maintains hours and minutes, and test it with another class TestClock. 1) Class Clock must support overloaded constructors for flexible initialization. 2) Clock objects can be printed in meaningful way. 3) Getter and setter methods will be supported for users to access the private instance variables hour and minute. Week12 a. Review class Rational. Introduce DrJava IDE for debugging and tracing. Low attendancy. b. Thanksgiving, no class Week13 a. General review with the help of DrJava tracing. Assignment 4 posted. b. Quiz 3. Week14 a. Cover tutorial code StaticDataMember.java, MethodOverloading.java, Aliases.java, ObjectParameterPassing.java, ArraysOfObjects.java (include object clone). Use slides to review Chapter 2 of Daniel Linag's textbook. b. Cover half of tutorial code InterfaceDemo.java.Focus on method overriding, constructor call sequence, and keyword super. Work on selected textbook Review Questions for chapters 2-6. Week15 a. Review class inheritance.Given a base class, practice writing a derived class to add new methods and override existing methods. Trace execution of subclass object generation. Work on selected textbook Review Questions for chapters 2-6. b. 3.25 Bubble Sort. Bubble sort animation. Review Questions for chapters 2-6. Rewrite BubbleSort to make all methods except main() to be non-static. Week16 a. Final exam. (December 20, 2005)