Honors Introduction to Computer Science I
CS181A Fall 2015
Antonio R. Nicolosi
Office hours: Mondays 1:00–2:00pm & Tuesdays 2:00–3:00pm, Babbio 624
Office hours: Mondays 2:00–3:00pm & Wednesdays
3:00–4:00pm, Lieb 318.
- Mondays 12:00–12:50pm, McLean 104
- Wednesdays, 12:00–12:50pm, McLean 119
- Thursdays, 12:00–12:50pm, McLean 104
- Labs / Recitation:
- Sec. A
- Tuesdays, 11:00am–12:40pm, Babbio 640
- Sec. B
- Tuesdays, 3:00–4:40pm, Babbio 640
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;
queue abstract data type;
recursion; searching and sorting; binary trees.
- Work load breakdown
2.5 hrs/week: Class attendance
2.0 hrs/week: Programming assignments—Lab work
2.5 hrs/week: Readings
5.0 hrs/week: Programming assignments—Homework
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
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.
Computer representation of numerical data: real numbers. Java and
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.
Computer representation of non-numerical data: Characters and strings.
Character encodings: ASCII and Unicode.
boolean primitive type. Review of Boolean
operators. The bitwise operators. Operators precedence and
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.
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
Java arrays. Programming with one-dimensional and multi-dimensional
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
Intro to object-oriented programming (OOP).
OOP concepts: Encapsulation. Objects state & behaviors.
The Java visibility modifiers. Accessor/mutator methods.
Constructors and the operator
overloading and the
this keyword. Class-level members:
Class variables and class methods.
Programming with class and instance members.
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
Aliasing and cloning of objects of reference type.
The stack and queue abstract data types. Implementing stacks and
queues with arrays.
More on inheritance. Inheritance of instance and class members.
Inheritance and constructors. The
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.
Sorting. Iterative sorting algorithms: InsertionSort,
Algorithm design techniques: Reduction and recursion. Examples of
reductions between problems. Solving problems with recursion.
Writing recursive methods. Tracing the execution of a recursive
Recursive sorting algorithms: QuickSort. HeapSort, MergeSort.
Recursive data types. Singly and doubly linked lists. Implementing
stacks and queues with lists.
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.
Introduction to event-driven programming.
Anatomy of a simple GUI application:
Listeners. A tour of Swing
components. Top-level containers and containment hierarchies.
More on event dispatching and listeners implementation.
Model-View-Control programming in the Swing API.
Trees. Tree traversal algorithms: Pre-order, in-order, post-order
traversals. Binary trees and binary search trees.
(Coding conventions for the
(Java source for code discussed in class/lab.)
Midterm & Final Exams
- Midterm I: October 1.
- Midterm II: November 5.
- Final: December 18
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