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:
- Lectures: Mondays, Wednesday 12:00–12:50pm, Babbio 310
- Recitations: Thursdays, 1:00–1:50pm, Babbio 221
- Lab: Thursdays, 4:00–5:50pm, Babbio 202
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
-
Java: Introduction to Problem Solving and Programming, 5/E
W.Savitch, F.M.Carrano
Prentice Hall, 2009
ISBN 0136072259 (ISBN-13: 9780136072256)
-
The Java Tutorial,
Fourth Edition
S.Zakhour, S.Hommel, J.Royal, I.Rabinovitch, T.Risser, M.Hoeber
Sun Microsystems, 2000–2008
Available on-line.
Trails/lessons:
Learning the
Java Language;
Essential
Java Classes:
Exceptions;
Creating a GUI
with JFC/Swing:
Using
Swing Components & Writing Event Listeners
Also available in book form: ISBN 0321334205 (ISBN-13: 978-0321334206)
Work Load
Breakdown
- Work load breakdown
2.5 hrs/week: Class attendance
2.0 hrs/week: Programming assignments—Lab work
3.0 hrs/week: Reading
6.0 hrs/week: Programming assignments—Homework
Academic Integrity
Weekly Topics
-
Intro. Computer architecture overview.
Machine programs: Instructions + Data. Binary arithmetics.
Computer representation of numerical data: Unsigned integers. Binary,
octal, and hexadecimal number systems.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
Typical memory layout of executing programs. The activation stack
& activation records. The memory heap: Allocation of Java
objects and garbage collection.
Midterm II.
-
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.
-
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.
-
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.
-
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.
-
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.
|
|