Honors Introduction to Computer Science I

CS181 Fall 2009

Instructor: Antonio R. Nicolosi
Office hours: Mondays & Thursdays 3:00–4:00pm, Babbio 624

Teaching Assistant: Matt Burlick
Office hours: Tuesdays 2:00–4:00pm, Burchard 127

Class Meetings:


Course Description

This is a fast-track introductory course in computer science using the Java programming language. Experience with Java is not required, as all topics will be developed from scratch, but you are expected to have had considerable high-school exposure to computer programming. You should be familiar with the following concepts: variables, arithmetic and Boolean operators, the assignment statement, (nested) if–else statements, (nested) loops, basic I/O.

Topics to be covered include: basic facts about computer systems; the compile/link/interpret/execute cycle; data representation; essential features of Java; elements of object-oriented programming in Java (encapsulation, polymorphism, inheritance); exceptions; GUI/event-driven programming; the stack and queue abstract data type; recursion; searching and sorting.

Reading

Work Load Breakdown

Academic Integrity

Weekly Topics

  1. Intro. Computer architecture overview. Machine programs: Instructions + Data. Binary arithmetics.
    Computer representation of numerical data: Unsigned integers. Binary, octal, and hexadecimal number systems.
  2. Computer representation of numerical data: Signed integers. Two's complement, sign-and-magnitudes, and bias/excess notations. Signed and unsigned overflow. Numeric literals in Java.
  3. Computer representation of numerical data: Binary fractional values. Java and the (reduced) IEEE 754 floating point standard.
    Computer representation of non-numerical data: Characters and strings. Character encodings: ASCII and Unicode. Java Strings. Java literals for the char and String types.
    Anatomy of a simple Java program. Java tokens: Comments, reserved words, identifiers, whitespace, punctuation, literals. Simple I/O via the Java API.
  4. The three ‘S’'s of programming: Syntax, semantics, and style. Documenting programs: Style, comments, and naming conventions.
    Boolean algebra and boolean/logic/bitwise operators. Expressions: Operators precedence and associativity. Assignments. Short-circuited evaluation.
    Conversions amongst Java primitive types.
  5. Programming fundamentals: Variable declarations and initialization; statements; blocks; decision and repetition control structures. Loop design and loop invariants. Java arrays. Programming with arrays. Arrays of reference types. Multi-dimensional arrays.
    Intro to Object-oriented programming (OOP).
    Midterm I.
  6. Working with objects: The operator new. Method invocation: Arguments and formal parameters. Pass-by-value and side effects. Primitive wrapper classes, boxing and unboxing. Simple programmer-defined classes. The this keyword. Constructor overloading.
    OOP concepts: Encapsulation. Objects state & behaviors. Accessor/mutator methods.
  7. Class-level members: Class variables and class methods. Programming with class and instance members.
    Method overloading. Constructor overloading. Overloading and type conversion. Aliasing and cloning. Overriding methods from java.lang.Object.
    Working with multiple classes: Java packages. Compiling and running code in Java packages.
  8. More on Java variables: Scope & visibility. Tracing variables. Local variables vs. formal parameters vs. instance variables vs. class variables.
    The stack abstract data type. Implementing stacks with arrays. The queue abstract data type. Implementing queues with circular arrays.
  9. Typical memory layout of executing programs. The activation stack & activation records. The memory heap: Allocation of Java objects and garbage collection.
    Midterm II.
  10. OOP concepts: Inheritance. Code reuse and sub-typing in inheritance. Inheritance of instance and class members. The protected visibility modifier. Inheritance and constructors. The super keyword. Method overriding. Final methods and classes. Abstract methods and classes.
    OOP concepts: Polymorphism. Derived-type to base-type assignment and casting. Compile-time (static) type vs. run-time (dynamic) type. Dynamic binding: examples. The instanceof operator and base-type to derived-type casting.
  11. More on polymorphism: Overriding vs. hiding. Interfaces in Java. Interfaces and modularity. Interfaces and sub-typing.
    The Java exception hierarchy. Catching exceptions. Checked vs. unchecked exceptions. The catch-or-specify requirement. Some frequently-thrown exceptions. The instanceof operator and the ClassCastException.
    Programmer-thrown exceptions & defining custom exceptions. More on exception catching and (re-)throwing. Java exceptions and the activation stack.
  12. Introduction to event-driven programming. Anatomy of a simple GUI application: Components, Events, Listeners. A tour of Swing components. Top-level containers and containment hierarchies. More on event dispatching and listeners implementation.
  13. Algorithm design techniques: Reduction and recursion. Example of reductions between problems. Solving problems with recursion. Writing recursive methods. Tracing the execution of a recursive method. Recursion and induction.
    Midterm III.
  14. Recursive data types. Singly and doubly linked lists. Implementing stacks and queus with lists. The collection API.
    Sorting. Iterative and recursive sorting algorithms: InsertionSort, SelectionSort, BubbleSort, QuickSort, MergeSort, HeapSort. Implementations with lists and arrays.
    Trees. Tree traversal algorithms: Pre-order, in-order, post-order traversals. Binary trees and binary search.

Homework & Programming Assignment

(Coding conventions for the programming assignments.)

Misc On-line Resources


Credits: Antonio Nicolosi, Dan Duchamp, David Naumann
Permission hereby granted for anyone to copy, modify, and redistribute any lecture note material from this class that belongs to the instructor.
Valid HTML 4.01! Valid CSS!