CPSC 225 Intermediate Programming Spring 2020

CPSC 225 Course Information

On this page:


Course Description and Objectives

Catalogue description:

This course builds on CPSC 124, covering some of the more advanced fundamentals of programming including basic data structures (such as lists, stacks and queues, binary trees, and hash tables), recursion, common algorithms (such as searching and sorting), and generic programming. This course also looks more deeply at object-oriented programming, including the use of class hierarchies. Currently, the course is taught using the Java programming language.

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 (CPSC 124) 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 (CPSC 225) 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.

This course covers basic data structures (arrays, linked lists, and binary trees) and abstract data types (lists, stacks and queues, priority queues, maps, and sets) as well as some common algorithms (searching and sorting), fundamental algorithmic techniques (recursion), and writing correct and efficient programs. It also takes a deeper look at object-oriented programming. Some additional topics such as GUI programming, client-server programming, streams and files, and threads may be covered as time permits. The course is taught in Java.

By the end of the course, the successful student should be able to:

  • describe the tradeoffs in efficiency and memory usage for arrays and linked lists (all variations)
  • 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
  • describe and implement the typical operations for lists, stacks, queues, priority queues, maps, and sets given a particular implementation
  • use the major classes of the Java Collections framework
  • explain what an abstract data type is
  • describe, implement, and discuss the efficiency of common algorithms for searching and sorting
  • understand and implement recursive methods
  • design and implement algorithms involving recursive data structures
  • habitually comment code, including writing pre- and postconditions for every method
  • use assertions and exceptions appropriately
  • habitually include error-detection mechanisms
  • habitually define test cases to thoroughly test components of the program
  • do a close reading of the program's specifications to create a reasonable design for a program (organizing the code into appropriate classes and methods)
  • choose appropriate ADTs and implementations for particular applications, and defend the choices made in terms of suitability and efficiency

Prerequisites

C- or better in CPSC 124, or instructor permission


Textbook

Introduction to Programming Using Java, 8th ed. (version 8.1)
David Eck

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

You can also download a PDF copy or an ebook if you prefer an electronic version that you can read offline, or order a printed copy if you'd like something you can refer to away from the computer. See the "Downloading And Other Links" section at the bottom of the http://math.hws.edu/javanotes/ page for more information. We will primarily use the second half of the book, so you can order just Part II and access any necessary material from Part I online. Or, if you don't have a copy of Part I from CPSC 124 and would like the whole thing, you can save a few dollars by ordering the whole book instead of the separate parts. Please do not print out chunks of the text on the Math/CS department printers.

Any additional material will be handed out in class and/or posted on the course webpage.


Software

All of the software needed for this course is available on the computers in two labs: Rosenberg 009 and the Math/CS lab (Lansing 310).

All of our development will be done using Java 11 in the Eclipse development environment. It is a little inconvenient to work on a single project on multiple computers without using version control, but if you want to set up your own computer so that you can work on assignments without going to one of the labs, you can. You will need several things:

  • Java 11 (JDK, not JRE)
  • JavaFX
  • Eclipse 2019-06
  • a file transfer program

For Java 11 and JavaFX, see Getting JDK and JavaFX for information on obtaining and installing the right packages. The AdoptOpenJDK site is recommended for Java 11 if you aren't running Linux and installing through your distribution's package manager.

Integrated development environments (IDEs) such as Eclipse make the development of larger programs easier. You can download Eclipse version 2019-06 here - select either the "Eclipse Installer" at the top of the page or the "Eclipse IDE for Java Developers" version partway down the page and choose the appropriate version for your computer (Mac, Windows, or Linux). It is recommended that you switch to this version of Eclipse even if you have an older version already installed.

Some Eclipse setup will be done in the first lab. You will need to carry out the same steps to configure your own installation.

Finally, you will need a way to transfer files between your computer and the department filesystem. Using a file transfer program is more convenient than emailing files to yourself, and doesn't require you to remember to transfer the files before switching to another computer. Follow the directions here to download, install, and use the appropriate file transfer program for your computer.

Note that Eclipse projects store some environment-specific configuration information and Eclipse does some management of the workspace directory on its own, so your best bet for transferring projects between the CS computers and your own is to copy the project folder somewhere other than into your workspace, create a new project within Eclipse on the current computer (if you don't already have one for the program you are working on), and then import the source files from the copied folder to the new project via Eclipse. It's a bit awkward but it does get the job done. Stop by office hours if you need help with this or any other aspect of getting your computer set up.