JMU JMU - Department of Computer Science
Help Tools
PA1: Graphical User Interfaces


1 Purpose

The primary purpose of this assignment is to help you review (and demonstrate that you have acquired) the knowledge and skills required to create graphical user interfaces (GUIs) in Java.

This assignment will also help you gain some experience with the user interaction issues that arise when developing personal navigation systems.

Finally, it will help you review what you have learned in previous courses about data structures and algorithms (including worst-case performance).

2 Overview

Nearby is a (fictitious) company that develops personal navigation systems, en-route and mobile commerce systems, location-based services, and geographic tracking/location services. They are in the process of developing a personal navigation system called Way. They have hired you to construct several interfaces/classes that will, ultimately, become part of this product.

For this assignment, you will be developing some components for an address entry system.

3 Preparatory Tasks

Before you do anything else you should:
  1. Setup your IDE. (See the course "Help" and "Tools" pages for information about the recommended environment.)
  2. Read all policies related to programming assignments (including style guides, submission requirements, collaboration rules, etc...).

4 Design Document

Nearby has provided you with the following design document:

5 Questions to Think About before Starting

You do not need to submit answers to the following questions, but you should think about them before you start writing code.
  1. What data structure should you use to organize the list of words (e.g., a contiguous linear structure, a linked linear structure, a contiguous tree structure, a linked tree structure, etc.)? If you use a linear structure, should the words be sorted?
  2. What algorithm should you use to find words that begin with the given prefix? Does the algorithm vary with the data structure?
  3. What is the worst-case time and space efficiency of the solution you chose?

6 Testing

You must write unit tests for the WordFinder class. You must use JUnit (v5) for this purpose. Your JUnit test suite must cover all statements and all branches (as measured by EclEmma) in WordFinder, CompletingField, and CompletingDocument. Your unit tests must be in a package named testing and each test class must include the word "Test" in its name.

Nearby has provided you with the following file that you can use for this purpose.

You must also perform integration testing on all of the components you write. Nearby has provided you with the following classes and files that you can use for this purpose.

The data file and the logo file must be accessed from the current working directory (i.e., they must not be accessed using a path). In Eclipse, this means that you must copy the files into the project directory/folder (not the src folder or any folder underneath it).

7 Submission

You must submit (using Gradescope) a .zip file named sub1.zip that contains:
  1. Your gui, text, and testing packages (packaged appropriately). Do not submit the app package and do not submit any data files. street-names.txt will be available on Gradescope in the current working directory.

There is no limit on the number of submissions and no penalty for excessive submissions.

8 Grading

Your submission will be "autograded" as follows:

Points will be deducted manually (i.e., after the due date) for code that is unclear, inelegant, and/or poorly documented.

9 Help

You should be a fairly proficient object-oriented programmer at this point. However, in case you've forgotten some details, help is available.

9.1 Help with Java

The course "Help" pages (see the section on "Course Content") on Java and UML contain many useful references in case you need to refresh your memory. You also may want to refer to the "review lectures" at the top of the syllabus.

9.2 Help with Eclipse

Be careful when you create projects in Eclipse that you create separate directories/folders for source and class files. Also, make sure that Eclipse does not create a module-info.java file and/or does not put your code in modules.

Be careful when you create classes in Eclipse that you put them in the appropriate package.

9.3 Help with Testing

We will be using JUnit all semester. For more information see:

Note that you should be able to cover all of the statements and branches in the CompletingField class by testing the CompletingDocument class.

9.4 Help Creating the .zip File

The directories/folders containing the packages must appear at the top of the .zip file. So, you must not compress the directory/folder containing these directories/folders, you must compress the directories/folders containing the packages. In other words, if you have a directory named src inside of a directory named pa1 that contains the directories app, gui, text, and testing, you must not compress src or pa1, you must compress text, gui, and testing.

Help with creating .zip files is available on the CS Wiki. In particular, see:

9.5 Help with Gradescope

General help with Gradescope is available on the CS Wiki. For more information, see:

If Gradescope reports errors in the "CompileOfficialTests" section it means that your code does not conform to the specifications.

Make sure that the code that you submit does not make any GUI components visible because Gradescope is running a "headless" version of Java (i.e., a version without displayable components).

Copyright 2025