Honors Introduction to Computer Science I
CS181A Fall 2017
Antonio R. Nicolosi
Office hours: Tuedays & Wednesdays 1:00–3:00pm, 317
Mondays, Wednesdays & Thursdays 12:00–12:50pm, Carnegie 316
- Sec. A
- Tuesdays, 11:00am–12:40pm, Babbio 319
- Sec. B
- Tuesdays, 3:00–4:40pm, Burchard 229
This is a fast-track introductory course in computer science using the
Java programming language. Knowledge of Java, as gained in a typical
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
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;
queue abstract data type;
recursion; searching and sorting; binary trees.
The Java Tutorial,
S.Zakhour, S.Hommel, J.Royal, I.Rabinovitch, T.Risser, M.Hoeber
Sun Microsystems, 2000–2008
Creating a GUI
Swing Components & Writing Event Listeners
Also available in book form: ISBN 0321334205 (ISBN-13: 978-0321334206)
to Java Programming and Data Structures
Prentice Hall, 2017
Currently, the latest edition is the 11th (ISBN-13: 9780134670942).
This is not a required book, but a solid reference if you are
looking for one (either in its "brief" or
Breakdown & Grading
- 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
24%: Homework & Programming Assignments
10%: Pair-programming labs (drop best and worst)
36%: Midterms I & II
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.
boolean primitive type. Review of Boolean
operators. The bitwise operators. Operators precedence and
Computer representation of non-numerical data: Characters and strings.
Character encodings: ASCII and Unicode.
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.
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.
Tracing the value of variables. One-dimensional and
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.
Review of object-oriented programming (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.
Inheritance. Code reuse and sub-typing in inheritance.
Derived-type to base-type assignment and casting.
instanceof operator and base-type to derived-type
More on inheritance. Inheritance of instance and class members.
Inheritance and constructors. The
Polymorphism. Compile-time (static) type vs. run-time
(dynamic) type. Dynamic dispatch (a.k.a dynamic dispatch): examples.
Method overriding. Overriding vs. overloading. Overriding
Overriding vs. hiding.
Abstract methods & abstract classes.
Rudiments of Uniform Modeling Language (UML):
Programming with class and instance members.
Sorting. Iterative sorting algorithms: InsertionSort,
Loop design and
Programming with one-dimensional and multi-dimensional arrays.
The stack and queue abstract data types. Implementing stacks and
queues with arrays.
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.
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 data types. Singly and doubly linked lists. Implementing
stacks and queues with lists.
Recursive sorting algorithms: QuickSort, HeapSort, MergeSort.
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 2, 2017
- Midterm II: October 30, 2017
- Final: December 16, 2017
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