CPSC 225 Intermediate Programming Spring 2014

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, the use and implementation of basic data structures (including arrays, linked lists, stacks, queues, trees), using Java's Collections framework, choosing appropriate data structures for the situation, recursion, and working with streams and files. Additional topics such as networking, threads, and GUI programming will be covered as time permits.


Stina Bridgeman
Lansing 312, x3614

Course Web Page

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


Introduction to Programming Using Java, 6th ed. (Part II)
David Eck

The book is available online at http://math.hws.edu/javanotes/.

You will probably find it convenient to have a printed copy of the text for easy reference during class. Printed copies can be ordered from lulu.com. We will primarily use the second half of the book, so make sure you order Part II. Some material from the first half of the book will also be used; if you do not have a copy of Part I from CPSC 124 and want a printed copy of everything, you can save a few dollars by ordering the whole book. Please do not print out chunks of the text on the Math/CS department printers.

PDF copies of the text are also available if you prefer an electronic version that you can read offline. See the "Downloading And Other Links" section at the bottom of the http://math.hws.edu/javanotes/ page.

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


C- in CPSC 124, or instructor permission

Rationale, Aims, and Objectives

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. This 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.

The course material can be divided into five major sections: program design, correctness and debugging, data structures and abstract data types (ADTs), 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 considers program design within the object-oriented paradigm, focusing on organizing the program's data into classes. It continues the approach introduced in CPSC 124, based on 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

Correctness, Robustness, Testing, and Debugging: Writing a program is only half the job - the 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

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 the program runs, and how easy it is to write and understand the program. Topics include low-level data structures (arrays and linked lists), high-level abstract data types (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 involving these data structures
  • be able to describe and implement the typical operations for 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

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, networking, and GUI programming.


  • 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]
  • be able to create a GUI using Swing [time permitting]

Valid HTML 4.01!