CPSC 225 Intermediate Programming Spring 2008

CPSC 225 Course Information

Course Description

This course continues the study of programming begun in CPSC 124. CPSC 124 focused on the syntax and semantics of Java and introduced basic programming concepts; this course moves beyond the nuts and bolts of a particular language to consider the larger picture of developing more complex programs. Topics include correctness and robustness, working with streams and files, recursion, the use and implementation of basic data structures (including arrays, linked lists, stacks, queues, trees), using Java's Collections framework, and choosing appropriate data structures for the situation. Additional topics such as networking and threads will be covered as time permits.

Course Web Page

You are expected to regularly consult the course web page for announcements, assignments, and most handouts.


Introduction to Programming Using Java, 5th ed.
David J. Eck

We will be using part of chapter 7 and chapters 8-11. The entire text is available online at http://math.hws.edu/javanotes/. A printed and bound copy of the second part of the book will be handed out early in the semester. (This is what the course fee covers.)

Additional material will be handed out or posted on the course webpage.


C- in CPSC 124, or instructor permission


Computer science revolves around programs - creating programs, analyzing programs, making programs more efficient and easier to understand, making it easier to create and maintain programs, considering what programs can and cannot do...the list goes on. The first semester of programming is intended to introduce basic programming skills - the syntax and semantics of a particular programming language, and some of the basics of program design. The second semester of programming is intended to build a more sophisticated and confident programmer by focusing on skills necessary for the construction of larger, more complex programs. The emphasis on data structures and data organization reflects the importance of managing data in programs - choosing an appropriate data structure for a particular application is important for the program's efficiency and simplicity. In addition, more time is spent writing programs of a significant size - much skill in programming comes from experience.

Course Content Overview

The course material can be divided into five major sections: program design, data structures and abstract data types (ADTs), testing and debugging, algorithmic techniques, and additional topics. It is worth noting that most of this material is not specific to any one programming language - while we will study them in the context of Java, the ideas and strategies can easily be applied to many other programming languages.

The objectives listed below paint - in broad strokes - what the successful student should be able to do at the end of each section.

Program Design: This course introduces program design within the object-oriented paradigm, focusing on organizing the program's data into classes. We will look at doing a close reading of the program's specifications to deduce classes and methods.


  • be able to do a close reading of the program's specifications to create a reasonable design for a program (organizing the code into appropriate classes and functions)
  • choose appropriate data structures and implementations for particular applications, and defend the choices made

Data Structures and Abstract Data Types (ADTs): Programs are, ultimately, all about manipulating data. How that data is stored and accessed can have a significant effect on how quickly a program runs, and how easy it is to write and understand a program. Topics include low-level data structures (arrays and linked lists), high-level abstract data types (vectors, lists, stacks, queues, binary trees, maps), and the Java Collections framework.


  • be able to describe the tradeoffs in efficiency and memory usage for arrays and linked lists (all variations), and to choose the most appropriate for a given application
  • be able to correctly implement basic algorithms involving arrays, linked lists, and binary trees (e.g. traversal, insertion, removal) and to work out algorithms for new tasks
  • be able to describe and implement the typical operations for vectors, lists, stacks, queues, and binary trees given a particular implementation
  • understand the ideas of abstraction and generic programming and why it is important to create reusable code
  • be able to explain what an abstract data type is
  • be able to choose an appropriate ADT for a given application
  • understand Java's approach to generic programming and be able to use the major classes of the Collections framework

Testing, Debugging, and Robustness: Writing a program is only half the job - a program must also be thoroughly tested in order to verify that it works correctly. If a test fails, then the error must be located and corrected. Topics include designing robust programs (i.e. error-checking), error-prevention (or at least early detection) strategies, designing comprehensive tests, and debugging strategies.


  • be in the habit of writing pre- and postconditions for every function/method, and properly commenting your code
  • be in the habit of including error-detection mechanisms in your code
  • understand and be able to use assertions and exceptions appropriately
  • understand and employ unit testing
  • be able to create a test suite to thoroughly test a program
  • be able to systematically track down the location and cause of a bug in most circumstances

Algorithmic Techniques: One of the most useful realizations in programming is that the same kinds of problems arise over and over. Solving new problems becomes easier as you build up a toolbox of solution "patterns" - if you can match characteristics of your current problem to one that you already know how to solve, you may be able to use the known solution as a starting point for the current problem. A thorough study of algorithmic patterns is beyond the scope of this course (take CPSC 327!), but we'll be alert to solution patterns as we come across them and will study recursion - a powerful technique which can lead to some very elegant solutions.


  • understand the idea of solution patterns, and recognize common patterns
  • understand the concept of recursion
  • implement recursive definitions
  • design and implement algorithms involving recursive data structures

Additional Topics: A variety of techniques are used in real software. We will study using streams and files and, as time permits, other topics such as threads and networking.


  • understand and be able to write Java programs streams and files
  • understand and be able to write multithreaded Java programs [time permitting]
  • understand and be able to write Java programs which communicate over a network [time permitting]

Valid HTML 4.01!