Honors Introduction to Computer Science I

CS181A Fall 2017

Instructor: Antonio R. Nicolosi
Office hours: Tuedays & Wednesdays 1:00–3:00pm, 317 North

Course Assistants:
Justin Barish
Christopher Hittner
Mark Knapp

Class Meetings:

Course Description

This is a fast-track introductory course in computer science using the Java programming language. Knowledge of Java, as gained in a typical AP Computer Science A course, is assumed, 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, object-oriented program design, inheritance.

Topics to be covered include: basic facts about computer systems; binary arithmetic; data representation; review of 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.

Recommended Readings

Work Load Breakdown & Grading

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.
    The boolean primitive type. Review of Boolean operators. The bitwise operators. Operators precedence and associativity.
    Computer representation of non-numerical data: Characters and strings. Character encodings: ASCII and Unicode.
  3. Computer representation of numerical data: real numbers. Binary periodic fractional values. Java and the (reduced) IEEE 754 floating-point standard.
    Command-line arguments and simple I/O via the Java API.
  4. Anatomy of a simple Java program. Java tokens: Comments, keywords, identifiers, literals, operators, punctuators.
    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.
    Documenting programs: Style, comments, and naming conventions. The basics of javadoc.
  5. Tracing the value of variables. 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.
    Local variables vs. formal parameters vs. instance variables vs. class variables.
  6. Midterm I.
    Review of object-oriented programming (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.
    Inheritance. Code reuse and sub-typing in inheritance. Derived-type to base-type assignment and casting. The instanceof operator and base-type to derived-type casting.
  7. More on inheritance. Inheritance of instance and class members. Inheritance and constructors. The super keyword.
    Polymorphism. Compile-time (static) type vs. run-time (dynamic) type. Dynamic dispatch (a.k.a dynamic dispatch): examples. Method overriding. Overriding vs. overloading. Overriding methods from java.lang.Object. Overriding vs. hiding. Abstract methods & abstract classes.
    Rudiments of Uniform Modeling Language (UML): Class diagrams. Programming with class and instance members.
  8. Sorting. Iterative sorting algorithms: InsertionSort, SelectionSort, BubbleSort.
    Loop design and loop invariants.
    Programming with one-dimensional and multi-dimensional arrays.
    The stack and queue abstract data types. Implementing stacks and queues with arrays.
  9. 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.
  10. Midterm II.
    Algorithm design techniques: Reduction and recursion. Examples of reductions between problems. Solving problems with recursion: Binary search, Gray code, Hanoi towers.
    Writing simple recursive methods. Tracing the execution of a recursive method.
  11. Recursive data types. Singly and doubly linked lists. Implementing stacks and queues with lists.
    Recursive sorting algorithms: QuickSort, HeapSort, MergeSort.
  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!