JMU CS345 - Software Engineering
Help Policies Solutions Study-Aids Syllabus Tools
Homework: OOP Input/Output Review


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 perform basic input/output in Java. From a language and algorithms perspective, there is nothing new in this assignment. There is also nothing new from a software engineering perspective.

2 Overview

As you know from an earlier assignment, SagaciousMedia is a (fictitious) company that develops educational hardware, software, and content for both the formal and informal education markets. SagaciousMedia's products are designed to excite and educate students, and to inspire and assist teachers/instructors.

v1 of their Gradient application worked only with a single course structure (i.e., for a course that has 6 programming assignments (with the lowest dropped) that account for 40% of the course grade, 5 homework assignments that account for 10% of the course grade, one midterm exam that accounts for 20% of the course grade, and a final exam that accounts for 30% of the course grade.) v2 of Gradient reads the course structure and assignment grades from a file.

3 Starting Point

This assignment builds on H1. You may start with either your solution to H1 or my solution to H1. However, there is no guarantee that my code is correct; you are responsible for any and all mistakes in your submission.

4 Documents

Sagacious Media has created several new documents for this release.

5 Testing

Some of the tasks that you must complete involve unit testing. You must use JUnit for this purpose. Your JUnit test suite must cover all statements and all branches (as measured by EclEmma) in all of the classes/enums you submit, including the classes/enums from earlier assignments (whether you actually wrote them or I did). You should neither write tests for, nor submit, the Gradient class. Your tests must be in a package named testing and each test class must include the word "Test" in its name.

Note that it will be difficult to test the CourseReader class directly. Instead, you will need to test it by ensuring that the objects it constructs (i.e., the Course object and the Category objects it contains) are correct (i.e., that each one has the correct key and value). Since each module can't be tested in isolation, this is a form of integration testing.

6 A Recommended Process

As before, the tasks that were identified by the team at Sagacious Media are organized by story. Hence, though they are numbered so that they can be referred to in documents and conversations, the numbers should not, in any way, influence the order in which you complete them. I would suggest you use the following process:
  1. Create a new project for this version and copy the classes from the previous version to do this one. (We'll talk about other ways to deal with this issue later in the semester.)
  2. Add a package named grading.io.
  3. Implement the Category class.
  4. Test and debug the Category class.
  5. Implement the Course class.
  6. Test and debug the Course class.
  7. Create a CourseReader class that has a stubbed-out readCategory() method.
  8. Implement the readCourse() method in the CourseReader class.
  9. Test and debug the readCourse() method.
  10. Implement the readCategory() method in the CourseReader class.
  11. Test and debug the readCategory() method.
  12. Test and debug the complete system.

7 Submission

You must submit (using Gradescope) a .zip file named sub4.zip that contains:
  1. "Your" implementation of the required interfaces/classes/enums in the appropriate package(s) (not including the Gradient class).
  2. JUnit tests for all of the classes/enums you submit (in a package named testing) Note: Your tests must only make use of the data files that were provided to you, which you must not submit.

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

8 Grading

Your submission will be graded as follows:

Note that some criteria are described as being "Success Required". This means that Gradescope will not assess subsequent criteria unless these criteria are satisfied (and you will receive a grade of 0 for those criteria). So, for example, if your code does not conform to the style guide then it will not be assessed using any subsequent criteria and you will receive a grade of 0.

As always, points will be deducted for code that is unclear, inelegant, and/or poorly documented.

9 Help with the Data Files

You should download the .zip file containing the data files into the downloads directory/folder that you created for this course. You should then unzip them in that same directory.

After you have unzipped the data files you must open a file explorer or finder, select all of the files, and drag them into Eclipse. Specifically, you must drag them into the project (not the src directory/folder or anything underneath it).

Then, in your code that needs to use these files (e.g., your tests), you should use only the file name (i.e., do not include a path). For example, you might construct a BufferedReader named in as follows:

BufferedReader in = new BufferedReader(new FileReader("complete_01.grd"));

It is possible to put the data files elsewhere, but then, when you submit your solution, your code will not be able to find them. In other words, for your code to work both on your computer and on the submission system, the data files must be dragged into the Eclipse project.

All of the data files will be available on Gradescope for you to use in your tests (assuming you follow the instructions above).

Copyright 2025