Review of Loops, Arrays, File I/O


Essentials

Due:

Key:


Overview

The objective of this assignment is to refresh your knowledge of how to solve simple programming problems involving conditionals, loops, nested loops, array indexing, and processing data from a file.

The assignment is also designed to help you create and test your code incrementally. It will also teach you to work with multiple classes, only one of which you actually write.

The assignment consists of three java classes.

Here is the documentation for the classes. Study the documentation for details on how to complete your implementation.


Getting Started

Create a new project in your favorite IDE. Add the three .java files to your project. The easiest way to do this is to right click on the link, then use Save Target as ... to copy the file into your project. Then use the IDE's capabilities to create initial implementations of all the methods you need to write. You now have a completely functional program. However, it will not give the correct results.

The code in AssignX.java has been designed to make it easy for you to write one method at a time and then test it before moving on. Because of the Shell, you need only complete the code you want to test. For example, you might first implement divides(). Then run MyAssign1. When the program starts type div 15 3 and verify you get the correct result. You may type as many commands as you want. When you are done, type exit. Use the help command to see all your options.

As a suggestion, you might implement the methods in the following order

  1. divides()
  2. findMultiples()
  3. merge()
  4. trio()
  5. wordCount()

Submitting Your Assignment

Submit the single file MyAssignX.java using the Checkin tab of the course website or at a terminal type:

~csXXX/bin/checkin XXX MyAssignX.java

(c) Fritz Sieker 2010-2015