Some test cases have been provided for you but none of


I have an assignemt taht needs a good programmer!! its about Java coding.

Assignment 3: Dots Game

Setup

1. Download the assignment.zip and unzip it. This will create a folder user-labsection- assignment3

2. Rename the folder replacing user with the first part of your GMU email address and labsection with your lab section.

? Example: krusselc-206-assignment3 (Katherine Russell, Lab Section 206)
? The folder already contains some code.

3. Complete the readme.txt file (an example file is included: exampleReadmeFile.txt)

Part 1: Dots Game

You are going to write the back end of a game. A GUI has been provided for you as well as a main method that just prints out a single run of the game. This game is a little like pachinko in that balls (which we will call "dots") are dropped from the top of the board and fall down over a series of "pins" that make them go left or right. The board will be represented as a series of characters:

• 'O' (the capital letter o, not zero) will represent the balls ("dots")
• '^' characters will represent pins
• blank spaces will represent "open" areas of the board

Game Code Notes

While the basic game may seem quite simple, you are going to need keep in mind the following things while coding it:

• The game is played in two parts: (1) dropping a dot and (2) using a "step" function to slowly move the dot down the board. There will be separate methods for both these.

• Whenever a dot is dropped, the game will need to keep track of where that dot is on the board and whether or not it has come to a stop. There will be methods for the GUI to use to retreive this information.

• Each call to the "step" function will move the dot down the board one level. If "step" is called and the dot is not able to move, then the game will allow another dot to be dropped.

? This means that when a dot is at the bottom of the board, the "step" method will be called once more before the game "realizes" the dot has come to a stop.

• Four example game boards are provided to you in the "boards" folder. You can open these with any text editor.

• There are get/set position methods which will be used by the GUI to update what the boards look like. Position (0,0) represents the top left of the board.

Existing Code Layout

Two classes have been provided for you. The first is DotsInterface.java which contains the list of methods your Dots class must implement. The second is GameGUI.java which provides the GUI you will see demoed in class. Both of these have been entirely written for you and you do not need to edit them in any way.

Writing Two Custom Exceptions

You will be writing several classes yourself, with certain restrictions on what they must contain. The first class two classes you must write are InvalidBoardException and NoFallingDotException. As a reminder, to write custom exceptions like these, you must make a new class and "extend" some existing exception, i.e. the class declaration will look like:

Class YourNewExceptionName extends SomeOtherException

You do not need to put any code in these classes, just empty braces will do (see Assignment 2 GameFileNotFoundException.java). Both these classes should "extend" Exception (not RuntimeException or any other exception class).

Writing The Dots Game

This class will "implement" the DotsInterface (which means it promises to have all the methods whose signatures can be found in the DotsInterface which has been provided to you). The class declaration should look like:

Class Dots implements DotsInterface

The methods in DotsInterface have been commented fully with JavaDoc style comments. Those comments describe in detail what is expected of that method. The following may be helpful in understanding how these comments work:

Typical method comment:

/**
* A general text comment describing the method and what it does. Below
* this comment are "annotations" which give details on the method's
* parameters, what the method returns, and any exceptions it might throw.
*
* @param parameter1Name a description of the first parameter and what it is used for
* @param parameter2Name a description of the second parameter and what it is used for
* @return a description of what the method returns
* @throws ExceptionName a description of when the exception might be thrown
*/

Part 2: Unit Tests

Some test cases have been provided for you, but none of these test a full game. So:

1. In MyUnitTests.java, create one JUnit test for Dots.java. This test MUST:

• test a full game, from dropping the first dot to being unable to drop any more dots because the board is full
• test a board of size 3x3 or larger
• test a board with at least one pin

2. Run your unit tests against your implementation and see if your code passes.

3. Correct either your code or your unit test until you've got it working.

The example tests given to you have lots of examples of testing what a board looks like and how to tell if a dot has moved into the correct position.

Attachment:- assignment.zip

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: Some test cases have been provided for you but none of
Reference No:- TGS01480994

Expected delivery within 24 Hours