[SOLVED] CSSE2002 - Assignment 2

30.00 $

Category:
Click Category Button to View Your Next Assignment | Homework

You will receive the following solution file(s) instantly after successful payment:

zip file icon Assignment2-pvrtjd.zip (265.3 KB)
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
🔒 Securely Powered by:
Secure Checkout
5/5 - (2 votes)

Revision: 1.1.
Abstract
In this assignment you will add classes and methods to a base set developed in Assignment 1. As before, you are to implement exactly the public and protected aspects described in the javadoc.
Preamble
If you have questions about what is acceptable, please ask.
Supplied material
• This task sheet
• A .zip file containing html documentation (javadoc) for the classes you are to write. Unzip the bundle somewhere and start with doc/index.html.
• A .zip file containing supplied source code for you to build on. Do not modify the supplied files except to add required methods. Note that the supplied code will require you to implement DigException before it will compile.
Tasks
1. Implement the following classes and all described methods:
(a) Pair
(b) MapWalker
(c) BoundsMapper
(d) MapIO
2. Implement the following methods:
(a) Room.makeExitPair
3. Declare repr in Thing.
4. Implement repr() in the following classes: Critter, Builder, Explorer, Treasure.
5. Implement decode() in the following classes: Builder, Explorer, Critter, Treasure.
6. Write JUnit4 tests for the methods in the following classes:
• MapIO as MapIOTest
• BoundsMapper as BoundsMapperTest
Marking
F 55 Electronically Implementation and functionality:
Does the submission conform to the documentation?
S 25 By “humans” Style and clarity.
J 20 Electronically Student supplied JUnit tests:
Do the tests correctly distinguish between correct and incorrect implementations?
The overall assignment mark will be A2 = F + S + J with the following adjustments:
1. If F < 5, then S = 0 and J = 0 and “style” will not be marked.
2. If S > F, then S = F. 3. If J > F, then J = F.
For example: F = 22,S = 25,J = 17 ⇒ A2 = 22 + 22 + 17.
Functionality marking
Tests passed
F = · 55 Total number of tests
Each of your classes will be tested independently of the rest of your submission. Other required classes for the tests will be copied from a working version.
Functionality testing does not apply to your JUnit tests.
Style marking
As a style guide, we are adopting the Google Java Style Guide https://google.github.io/styleguide/javaguide.html with some modifications:
4.2 Indenting is to be +4 chars not +2.
4.4 Column limit for us will be 80 columns.
4.5.2 First continuation is to be +8 chars.
• Java source files must be encoded as either ASCII or UTF-8.
• All public and protected comments are expected to use javadoc markup (eg @param etc).
Naming 5
Commenting 6
Structure and layout 8 Good OO implementation practices 6
Note that this category does involve some aesthetic judgement (and the marker’s aesthetic judgement is final).
Test marking
When testing loadMap and saveMap you should test single room cases separately but for multiple room cases, test them together.
There will be some limitations on your tests:
1. If your tests take more than 20 seconds to run, they will be stopped and a mark of zero given.
2. Each of your test classes must be less than 300 (non-empty) lines. If not, that test will not beused.
These limits are very generous, (eg your tests shouldn’t take anywhere near 20 seconds to run).
Electronic Marking
The electronic aspects of the marking will be carried out in a virtual machine or linux box. The VM will not be running windows and neither IntelliJ nor Eclipse will be involved. For this reason, it is important that you name your files correctly.
Submission
Submission is via the course blackboard area Assessment/Ass2/Ass2 Submission. Your submission is to consist of a single .zip file with the following internal structure:
src/ .java files for classes described in the javadoc test/ .java files for the test classes
Note: you must submit supplied classes as well.
Your classes must not declare themselves to be members of any package. Do not submit any other files (eg no .class files). Any files or directories which do not match the above structure will be deleted before marking. Remember that java filenames are case sensitive even when your filesystem isn’t.
Revisions
Changes from 1.0
1. Changes to Javadoc:
(a) Changed text on the MapWalker constructor: the constructor is not supposed to call visit.The constructor should not do any actual walking.
(b) Added note to walk() that reset should be called at the beginning of the routine.
(c) Removed classes from javadoc that were removed from the assignment (eg DigException).
2. Changes to supplied files (these are all to make sure the supplied code complies with the styleguide):
(a) Added static final to (Critter): private static final int MAX_HEALTH = 10;
(b) Wrapped Explorer constructor line (3rd constructor) (c) Wrapped long line in Explorer class javadoc.
(d) Reordered imports in Player.
3. Changes to task sheet:
(a) Abstract changed to make it clear where helper classes can be used.
Changes from draft version
1. A typo in the example Explorer.repr output has been corrected.
2. I’ve dropped Builder.digExit() from the assignment. The javadoc was confusing and there isenough to do with the MapWalker and BoundsMapper. The supplied files have been updated.
3. I’ve dropped the DigException class and its subclasses RoomExistsException and OffTheMapException since they were only used by Builder.digExit()
4. Added missing getDamage() to Explorer in supplied files.
5. You will need to make sure that any subclass of MapWalker which overrides reset() calls super.reset(), to ensure that state is cleared properly.
6. I will not test the MapWalker constructor with a null argument.
7. Order of items in a Pair matters.
8. Critter has been modified to have a MAX_HEALTH to make saving and loading consistant.

  • Assignment2-pvrtjd.zip