In this exercise you will install and use the problem solving framework discussed in class (see menu to the left).

To begin, download this zipped project folder to an appropriate location on your machine and import it into NetBeans: ProblemSolver.zip.

This will produce a project called ProblemSolver whose structure looks like that below.

Note the domains.dummy and domains.arithmetic packages under both Source Packages and Test Packages.

Open the ProblemSolver project in NetBeans and open the source folders.

The project structure should look like this:

Name the project ProblemSolver and choose for location the ProblemSolver folder you just unzipped (extracted). Click Next.

In the next screen, click the Add Folder... button next to the Source Package Folders: area.

In the Browse Source Packages Folder dialog, navigate to the src folder inside the ProblemSolver folder. Click Open.

After locating the sources, the Existing Sources screen should look similar to that below.

Now click the Add Folder... button in the Test Package Folders section.

Clicking the Add Folder... button in the Test Package Folders section brings up a file browser dialog. Click the new folder icon circled in red below.

Name the folder "test", be sure to type ENTER, and click OK.

When finished, the source and test package folders should be similar to those below. Click Finish.

Open the handles on the ProblemSolver project in the Projects tab and open the associated subfolders. The structure must look like this:

Right click the DummyProblemTest.java node under Test Packages and choose Test File, as shown below left.

You should get the dummy application described in the problem solving framework lecture, also shown below.

Familiarize yourself with the use of the application.

   

Your job for this exercise is to become familiar with the problem solving framework by creating a simple arithmetic problem application.

A screenshot of the problem is shown below. To see how it is used, refer to the Video (mp4) for this module.

The classes you will implement fit into the problem solving framework in exactly the same way the classes for the dummy application (described in the problem solving framework lecture). See below.

You should model your arithmetic problem classes on their dummy problem counterparts.

Create a new source package called domains.arithmetic and add the new class files: Create a test class for ArithmeticProblem.java. Your project structure must look like:

This section describes how to implement and test the classes.

Since ArithmeticState does not depend on any other domain classes, start with it first.

Like DummyState, your ArithmeticState class must extend the framework's abstract State class. A template for the class is given for you and shown below. Use the DummyState example as a model. Do not move on until you have successfully tested it.

When you have written the ArithmeticState class, test it with the provided ArithmeticStateTest.java file, displayed to the right.

Right click ArithmeticStateTest.java in the project tree and select Test File.

When it is working correctly, the results will look like:

Like DummyMover, your ArithmeticMover class must extend the framework's abstract Mover class. A template for the class is given for you and shown below. Use the DummyMover example as a model. Do not move on until you have successfully tested it.

When you have written the ArithmeticMover class, test it with the provided ArithmeticMoverTest.java file, displayed to the right.

Right click ArithmeticMoverTest.java in the project tree and select Test File.

When it is working correctly, the results will look like:

Like DummyProblem, your ArithmeticProblem class must extend the framework's Problem class. A template for the class is given for you and shown below. Use the DummyProblem example as a model. Do not move on until you have successfully tested it.

When you have written the ArithmeticProblem class, test it with the provided ArithmeticProblemTest.java file, displayed to the right.

Right click ArithmeticProblemTest.java in the project tree and select Test File.

A console will appear and you can manually try moves and solve the problem. When you exit the console the results of the automated tests will be displayed.

If it is working correctly, the results will look like:

Like DummyConsole, your ArithmeticConsole class must use the framework's ProblemConsole class: There is no separate test class for ArithmeticConsole. To test it, simply run it and interact with the application. If your previous tests have succeeded, it will run like the ArithmeticSolver.jar application.
The test files required for this exercise are available from the menu on the left.
ArithmeticMoverTest.java

ArithmeticProblemTest.java

When your arithmetic problem is working correctly: Note the general Submission Policy in the menu at left.

Your project will be inspected, tested, and run by the lab instructor. Grading criteria: