Second Summer 2002


Calendar and Exams Office Hours Grading Course Materials QuizSite MyGrades

[01] June 17
[02] June 18
[01] Lab 1 (6/17)
[03] June 19
[04] June 20
[02] Lab 2 (6/20)
Homework One
[05] June 24
[06] June 25
[03] Lab 3 (6/24)
[07] June 26
[08] June 27
[04] Lab 4 (6/27)
Homework Two
[09] July  1
[10] July  2
[05] Lab 5 (7/1)
[11] July  3
[11] HOLIDAY
[06] No Lab
Homework Three
[12] July  8
[13] July  9
[06] Lab 6 (7/8)
[14] July 10
[15] July 11
[07] Lab 7 (7/11)
MIDTERM Fri 7/12
[16] July 15
[17] July 16
[08] PRACT 7/15
Homework Four
[18] July 17
[19] July 18
[08] Lab 8 (7/18)
[20] July 22
[21] July 23
[09] Lab 9 (7/22)
Homework Five
[22] July 24
[23] July 25
[10] Lab 10 (7/25)
[24] July 29
[25] July 30
[11] Lab 11 (7/29)
Homework Six
[26] July 31
[27] August  1
[12] Lab 12 (8/1)
[28] August 5
[29] August 6
[13] Lab 13 (8/5)
[30] August 7
[31] August 8
[14] Lab 14 (8/8)
FINAL Fri (8/9)

Where all the notes will be collected, in a format more suitable for ClassPak delivery.

Syllabus (Calendar and Exams)

Here's a brief syllabus for A201/A597/I210 this semester:

  1. Introduction.
  2. Fundamental data types.
  3. User-defined types.
  4. Decisions.
  5. Iteration.
  6. More about methods.
  7. Inheritance.
  8. Arrays and vectors.
  9. Algorithms.
  10. Applets.
  11. Basic event-handling.
  12. Basic graphical user interfaces.
  13. Introduction to threads.
  14. Basic video game design with Java.
  15. Case-study one: The alien landing game.
  16. Case-study two: A penguin in an Iceblox world.

Here now is a somewhat more detailed perspective on it:

  1. (Introduction)

    What computers can do and how. Programming languages. Java. Syntax. Writing simple programs for a robot-like penguin in rectangular world. Objects in Java and the syntax of method invocation. The edit-compile-run loop. Syntax of the simplest running program in Java, and the structure of main.

  2. (Fundamental data types)

    More examples of algorithms: a simple investment problem; positional algorithms for addition and multiplication of integers; calculating the greatest common divisor by Euclid's method; sorting a list of numbers.

    Simple programs that print strings. Syntax of strings. Simple expressions with numeric value. Number types. Integer vs. floating-point numbers. Some issues of precision and internal representation. Symbolic names. Variables. Declaration and initialization of (local) variables.

    Assignment statements. Operators, operands, precedence tables, left to right associativity, order of evaluation. Type conversion: casting a float value for assignment into an integer variable. Method invocation revisited. Math methods that return values: Math.sqrt(), Math.round(), Math.floor(), Math.ceil(), Math.pow(), Math.abs(), Math.max(), etc. Other integer types. Infinite-precision arithmetic with big number objects.

    Basic I/O in Java. Using ConsoleReader (a helper class) to write simple interactive programs. Objects revisited: using java.awt.Rectangle in a few programs. Basic introduction to the standard Java API and packages. Primitive types vs. reference types.

  3. (User-defined types)

    Basic modeling: designing a simple BankAccount class with one instance variable (the balance) and three instance methods (getBalance, withdraw, and deposit). Basic introduction to methods: their names and signatures.

    More about methods: return types. Parameters, arguments. Constructors as initialization procedures. Instance variables vs. local variables. Basic terminology in the context of this example: mutators vs. accessors.

    The null reference.

    The this keyword for self-reference. The use of this() in constructors.

  4. (Decisions)

    The boolean primitive type. Simple boolean algebra. De Morgan's laws. Syntax of an if statement. Nested branches, the dangling else problem.

    Relational operators. Comparing floating point numbers. The difference between reference and primitive types when comparing for equality.

    Indentation and style in writing programs.

  5. (Iteration)

    Basic while loops in the context of the investment problem from the beginning. Infinite loops. Syntax of the for and do-while loops. Equivalence between while and for loops. "Off by one" errors, the loop and a half problem. More syntax: break and continue. Nested loops and two-dimensional patterns. Loop invariants, correctness proofs (Euclid's algorithm).

    Case studies: generating random numbers, and using them in Monte Carlo experiments. Experimentally determining the value of pi. Frequencies and probabilities. Traversing the characters in a String using charAt(). The primitive type char and its relationship to integers. Using StringTokenizer to simulate a stack of String values in an interactive program. Strings and stacks as linear structures that anticipate our study of Java arrays.

  6. (More about methods)

    Classes and objects revisited: a diagrammatic review. Instance vs. static members. Variable initialization, lifetime and scope: parameters vs. local variables vs. instance variables vs. static variables. Side-effects. Recursion. Overloading. Case study: writing a Fraction class.

  7. (Inheritance)

    Basic description of the class extension mechanism through the set union of features example. Making the robot-like penguin in Iceblox smarter through class extension.

    Overriding of methods. The rule of dynamic method lookup.

  8. (Arrays and vectors)

    One-dimensional arrays of integers. Searching, counting, inserting, deleting, finding the maximum and the minimum values in an array of integers. Array parameters and return values. Parallel arrays. Arrays of objects. Vectors. Casting. Hashtables.

    Two-dimensional arrays.

  9. (Algorithms)

    Sorting: selection sort and bubble sort. Recursive methods of sorting.

  10. (Applets)

    Applets are described in the context set up at step 7 (above). The structure and life cycle of an applet. How paint() works: the rule for dynamic method lookup in action. Applets vs. applications. Basic HTML and the appletviewer application. The graphics context object and its methods. Graphical shapes, fonts, colors, and the ManyShapes applet.

  11. (Basic event-handling)

    Simple user input in an applet: listeners for the mouse and the keys. Interfaces. Events, event listeners, and event sources. Adapter classes. Implementing listeners as inner classes.

  12. (Basic graphical user interfaces)

    Windows and frames. Layout management. Basic AWT components.

    Case study: exploring the Swing documentation (the SliderTest program).

  13. (Introduction to threads)

    Definition of threads. The Runnable interface.

    The four kinds of threads programming problems:

    a) unrelated threads,
    b) related (but unsychronized) threads,
    c) mutually-exclusive threads, and
    d) communicating and mutually-exclusive threads.
    This presentation is valuable because it's meant to offer a glimpse of A202 programming, and also a short and complete course on generic threads programming (after van der Linden).

  14. (Basic video game design with Java)

    We take a look at double-buffering and implement an x-eyes applet.

  15. (Case-study one: The alien landing game)

    The program is developed step by step. It's meant to offer a clear perspective on what A202 might look like, also what it takes to create an enjoyable piece of software. (After Joel Fan.)

  16. (Case-study two: A penguin in an Iceblox world)

    Karl Hornell's 1996 original Iceblox program is used. The style of the program is completely procedural. Thus we have a very robust but extremely hard to understand computer game program. We are then presented with an alternative design that follows Hornell's organization exactly, but encodes everything using a hierarchy of classes starting with a World and an Actor class. Given that Hornell's original program is a paragon of procedural programming, the object-oriented version that we develop offers a clear understanding of the advantages that object-oriented design provides from a purely conceptual point of view.

Exams (and Grading, also see below):

Two written exams,

  1. a midterm and
  2. a final (both outside of class).

One practical exam,
  1. (during one of the labs).

Each of the 14 labs comes with
  1. a specific lab assignment
  2. to be turned in for credit.

There are six homework assignments on
  1. Types, expressions, basic statements, simple programs.
  2. User-defined types.
  3. Decisions and iteration.
  4. Programming with Java arrays.
  5. Graphics and event-handling in applets.
  6. Basic data structures (arrays, Vectors and Hashtables).

Minute papers collected every lecture count towards final grade.

There are multiple-choice exercises posted for practice in QuizSite.

Structure of labs (115 minutes long each):

The AI uses the first 15-20 minutes to go through the entire class and individually takes attendance, greets students to the lab, and asks each student to identify one or two most outstanding questions (s)he might have about the current or forthcoming lab and homework assignment. Thus the AI builds a set of FAQ for the lab, each lab, and soon learns the names of all students in the lab.

The AI combines the answers into a 20-30 min presentation which may involve student participation. The presentation is blending the topic for the day (predetermined) with the answers to the FAQ collected by the ad-hoc survey.

Last 60-70 minutes of the lab the AI again goes through the entire set of students and checks that the lab assignment has been completed. Student runs the lab program and answers one or two questions.

Grading scale for the lab:

45 points for showing up
up to 10 points for initial interaction (for the FAQ)
(4, 3, 2, or 1) x 10 points if the program is worth an A, B, C, or D.
Note: 95 is the highest A, 90 is the lowest. Points above 95 are only given for student work that is of such quality that it makes the AI want to share it with the entire class. Grade cutoffs are posted on the website, below.

Labs are meant to stimulate participation and encourage learning.

Exams and (to a significant extent) homework assignments are the main testing instruments used in the class.


Office Hours are listed in the table below:

Instructor Username Days Location Time
Adrian German dgerman MTWF LH201D
3-4pm
Thursday(only) LH201D 12:25-1:25pm
Richard Li yli TW LH016
(basement, Lindley)
5:30-6:30pm
Barry Li yinli MR LH016
(basement, Lindley)
2:30-3:30pm


Grading Scale (as mentioned above)

Course grades will be determined as follows:

Component Weight
6 Homework Assignments 25%
14 Lab Assignments 35%
Midterm Exam 15%
Practical Exam 15%
Final Exam 15%
Lecture Minute Papers 5%
TOTAL 110%

The overall cutoff scale is as follows:

0-54 55-65 66-67 68-69 70-75 76-77 78-79 80-85 86-87 88-89 90-95 96-100
F D D+ C- C C+ B- B B+ A- A A+


Course Materials

The textbook is pictured on the right.

Here's what you will need, in essence:

If you want to work from home you will need to install your own compiler. We might be able to assist you with that, but we make no promise. Lecture notes and lab notes will be posted regularly together with reading assignments. We will be checking out the on-line API (from Sun) frequently. Here's a no frames, and complete (plus a few extensions) for all packages from the same web site. And the author's web page for the textbook, including the style guide (PDF format). Here's the Java tutorial with a Win32 tutorial section, which should help if you work on a PC. Here also is the author's FAQ for the book, in case you need it.


Last updated: Jun 20, 2001 by Adrian German for A201