CPSC 225 Intermediate Programming Spring 2022

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
  • use recursive backtracking to solve problems
  • 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.3)
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 the Rosenberg 009 and Lansing 310 computer labs.

If you want to set up your own computer for programming in this course, you will need several things:

  • Eclipse 2021-12
  • Java 17 (JDK, not JRE)
  • JavaFX
  • a file transfer program

You can download Eclipse 2021-12 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; choose the x86_64 version unless you have a very new Apple device). It is recommended that you switch to this version of Eclipse even if you have an older version already installed. Run the installer or unpack the compressed archive file you downloaded (see below).

Eclipse 2021-12 includes Java 17, so you no longer need to download that separately.

You can download JavaFX from https://gluonhq.com/products/javafx/. In the "Downloads" section, choose the right JavaFX version (17.0.2), operating system, and type (SDK) from the dropdown menus to narrow the list of download links. You'll also need to choose the right system architecture - most likely x64 unless you have a very new (within the last year) Apple device (aarch64). Unpack the compressed archive file you downloaded (see below).

To unpack the JavaFX (and possibly Eclipse) archives downloaded, double-clicking on the file should either extract the contents or start a program that will let you extract the contents. The extracted files can go anywhere, but make a note of where they end up.

You will also 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 leaving the lab. See the SSH, SFTP, SCP section of Using Linux at HWS for information about commandline options (scp, sftp) which may already be available on your computer. If you prefer a GUI tool and don't already have one, FileZilla is free and runs on all platforms. (You only need to download the client, not the server.) Be sure to check out the documentation (especially the usage instructions). Enter "sftp://math.hws.edu" for the host and leave the port blank when establishing a connection.

Finally, you'll need to repeat the Eclipse configuration you did in lab 1. First, use the file transfer program to copy the formatter and code templates files from /classes/cs225/eclipse on the department filesystem to your own computer. Then go through the "Eclipse setup" section in the lab 1 handout, using your local copy of the code formatter and code templates files (navigate there instead of /classes/cs225/eclipse) and substituting the path where you unpacked the JavaFX download for /usr/share/openjfx/lib.

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 any aspect of getting your computer set up or sorting out the workflow of how you'd actually use all these pieces once they are installed and configured. (Bring your laptop.)