School of Arts and Sciences

College in High School Course Syllabus

Computer Science 0401
Intermediate Programming Using Java
(4 Credits)

The purpose of this course is to introduce the student to object-oriented programming and to improve programming skills through an introduction to the programming language Java. This is the first core course in the computer science major at the University of Pittsburgh.

Prerequisite: Previous programming experience, including basic data types, control constructs, functions, and arrays.

Requirements and grading: Grading will be based on programming assignments and exams.

The required text for this course is Java Software Solutions: Foundations for Program Design + Java Backpack Reference Guide, Louis and Loftus, fourth edition, Addison Wesley, ISBN 0321326199. Or, you may use any Java textbook as long as the material listed below is included in the book.

Note:

  • Topics 1–4 should be covered very quickly in at most a few classes, as the material should already be familiar to the students through CS 0007 or an equivalent course. The other topics should have more detailed coverage.
  • The Lewis and Loftus chapter order: 1, 2, 5, 3, 4, 6, 7, 8, 9, 11, 10.
  • A more detailed syllabus (with handouts) from last fall's CS 0401 course is available online.

1. Introduction

  • Algorithms
  • Implementing algorithms in Java
  • Why Java?
  • Using the JDK

2. Program Fundamentals

  • Data types and variables
  • User input
  • Numeric types
  • Arithmetic expressions
  • Assignment operators
  • Increment and decrement ops
  • Precedence and associativity

3. Statements and Control Flow

  • Boolean expressions
  • The if statements (and if-else)
  • The while statement
  • The for statement
  • Break and continue
  • The switch statement

4. Classes, Objects, and Methods

  • Definitions: class and object
  • Primitive types vs. object types
  • Reference variables and implications
  • Method invocation
  • Static methods
  • Scope of variables
  • Top-down design
  • Invocation and call-by-value

5. Writing Classes

  • Elements of a simple class
  • Public and private access: data
  • Hiding
  • Constructor methods
  • Accessors and mutators
  • Static fields and methods
  • Methods overloading
  • Interfaces

Side Topic: Files and File Access

  • Reading and writing text files
  • Formatting text output
  • Reading and writing binary files
  • Detecting end of output stream

Side Topic: Introduction to Graphical Applications

  • "Hello World"
  • Events and event listeners
  • Text and numerical input
  • Using graphical components
  • Layout managers

6. Arrays

  • One-dimensional arrays
  • Passing arrays to methods
  • Array assignment and references
  • Two-dimensional arrays
  • Arrays of objects

7. Inheritance and Polymorphism

  • "Is a" relationship
  • Overriding (vs. overloading) methods
  • Composition vs. inheritance for class design
  • Protected access
  • Type objects and inheritance
  • Wrapper classes
  • Abstract classes
  • Interfaces as pseudo-abstract classes and pseudo-multiple inheritance
  • Multiple inheritance

8. Searching and Sorting

  • Sequential search and binary search
  • Selection sort and insertion sort
  • Java generics: using the same code for multiple types

9. Recursion

  • Idea of incursion
  • Base case and recursive case
  • Examples: Fibonacci, binary search, towers of Hanoi

10. Exceptions

  • Try and catch
  • Throwing and exception
  • Exception handling and propagation
  • Exceptions in graphical applications

11. Preview of Data Structures (some coverage)

  • List interface
  • Linked list vs. array list
Top