Honors Introduction to Computer Science I

CS181A Fall 2015

Instructor: Antonio R. Nicolosi
Office hours: Mondays 1:00–2:00pm & Tuesdays 2:00–3:00pm, Babbio 624

Teaching Assistant: Ben Tucker

Course Assistant: Luke Smith
Office hours: Mondays 2:00–3:00pm & Wednesdays 3:00–4:00pm, Lieb 318.

Class Meetings:

Course Description

This is a fast-track introductory course in computer science using the Java programming language. Experience with Java is assumed (though most of the main features of the language will be reviewed in class), as is considerable prior exposure to computer programming. In particular, 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; binary arithmetic; 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; binary trees.


Work Load Breakdown

Academic Integrity

Weekly Topics

  1. Intro: Computer architecture overview. Machine programs: Instructions + Data.
    Computer representation of numerical data: Unsigned integers. Binary, octal, and hexadecimal number systems. Binary arithmetic.
    Working via the command line: A brief tour. (Windows setup instructions.)
  2. Computer representation of numerical data: Signed integers. Two's complement, sign-and-magnitudes, and bias/excess notations. Signed and unsigned overflow.
    Review of programming fundamentals.
  3. Computer representation of numerical data: real numbers. Java and the (reduced) IEEE 754 floating-point standard. Binary periodic fractional values.
    Anatomy of a simple Java program. Java tokens: Comments, keywords, identifiers, literals, operators, punctuators.
    Command-line arguments and simple I/O via the Java API.
  4. Computer representation of non-numerical data: Characters and strings. Character encodings: ASCII and Unicode.
    The boolean primitive type. Review of Boolean operators. The bitwise operators. Operators precedence and associativity.
    Java primitive types, Java Strings, and their literals. Conversions between Java primitive types and type casting.
    Simple programmer-defined classes. Java packages. Compiling and running code in Java packages.
  5. More programming fundamentals: expressions; assignments; statements and blocks; decision and repetition control structures.
    Tracing the value of variables.
    Documenting programs: Style, comments, and naming conventions. The basics of javadoc.
    Midterm I.
  6. Java arrays. Programming with one-dimensional and multi-dimensional arrays.
    Method invocation: Arguments and formal parameters. Pass-by-reference and side effects.
    Typical memory layout of executing programs. The activation stack & activation records. The memory heap: Allocation of Java objects and garbage collection.
    Loop design and loop invariants.
  7. Intro to object-oriented programming (OOP). OOP concepts: Encapsulation. Objects state & behaviors. The Java visibility modifiers. Accessor/mutator methods.
    Constructors and the operator new. Constructor overloading and the this keyword. Class-level members: Class variables and class methods. Local variables vs. formal parameters vs. instance variables vs. class variables.
    Programming with class and instance members.
  8. OOP concepts: Inheritance. Code reuse and sub-typing in inheritance. Superclasses vs. interfaces. Derived-type to base-type assignment and casting. The instanceof operator and base-type to derived-type casting.
    Method overriding. Overriding vs. overloading. Overriding methods from java.lang.Object.
    Aliasing and cloning of objects of reference type.
    The stack and queue abstract data types. Implementing stacks and queues with arrays.
  9. More on inheritance. Inheritance of instance and class members. Inheritance and constructors. The super keyword.
    Overriding vs. hiding. Abstract methods & abstract classes. Final methods & final classes. OOP concepts: Polymorphism. Compile-time (static) type vs. run-time (dynamic) type. Dynamic binding: examples.
  10. Sorting. Iterative sorting algorithms: InsertionSort, SelectionSort, BubbleSort.
    Algorithm design techniques: Reduction and recursion. Examples of reductions between problems. Solving problems with recursion. Writing recursive methods. Tracing the execution of a recursive method.
    Recursive sorting algorithms: QuickSort. HeapSort, MergeSort.
    Recursive data types. Singly and doubly linked lists. Implementing stacks and queues with lists.
    Midterm II.
  11. The Java exception hierarchy. Catching exceptions. Checked vs. unchecked exceptions. The catch-or-specify requirement. Some frequently-thrown exceptions. Programmer-thrown exceptions & defining custom exceptions.
    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. Layout managers.
  13. More on event dispatching and listeners implementation. Model-View-Control programming in the Swing API.
  14. Trees. Tree traversal algorithms: Pre-order, in-order, post-order traversals. Binary trees and binary search trees.

Homework & Programming Assignment

(Coding conventions for the programming assignments.)
(Java source for code discussed in class/lab.)

Midterm & Final Exams

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!