It should done in blueJ. There shouldn’t be public static void main method. Structure should be same as that of the class diagram in relation to connection with each classes. Only specified classes...


It should done in blueJ.


There shouldn’t be public static void main method.


Structure should be same as that of the class diagram in relation to connection with each classes.


Only specified classes should be used.


Only the specified field should be private which are shown in the class diagram and no fields should be used for those class where no filed is mentioned in the class diagram.


No static keyword should be used.


We can use arraylist only for that specified attribute.


They have given the .txt from which we have to read the content.


There should be the use of exception handling.


No static keyword should be used.


Even we should write to a file which is given in the specification.


Comments are needed of each methods.


There should be a test strategy for one class that is specified in the pdf.


There should be one test class which should have test strategy (refer page no. 14)


In validation class we have to include the validation (exception handling).


There should be one document in which will have strategy of specified class only.




5,true,true,3 FIT9131 FIT9131 Semester 2 2018 Assignment 2 19 September 2018 1 BattleShip “With a Twist” Introduction This assignment is due by 9 am Sunday of Week 12 (21st October, 2018). It is worth a total of 25% of the marks for your final assessment in this unit. Heavy penalties will apply for late submission. This is an individual assignment and must be your own work. You must attribute the source of any part of your code which you have not written yourself. Please note the section on plagiarism in this document. This assignment is structured as a 20% + 5% assessment. The code submitted for this assignment will be assessed for 20% of the marks and a unit test during the tutorial time in Week 12 will be assessed independently for 5% of the marks allocated. Please note that the unit test is a hurdle requirement for the assignment. Failing to complete the unit test will result in no marks being allocated for the entire assignment. The assignment must be done using the BlueJ environment. The Java source code for this assignment must be implemented according to the Java Coding Standards for this unit. Any points needing clarification may be discussed with your tutor in the lab classes. Specification For this assignment you will write a program which will allow a person to play a game called Battleship with a Twist. While many variations of this game are present, the one being implemented for this assignment is a specific variation to ensure all beginner programmers can achieve this outcome. This section specifies the required functionality of the program. Only a text interface is required for this program; however, more marks will be gained for a game that is easy to follow with clear information/error messages to the player. The aim of Battleship with a Twist is for a player to try and destroy all of the computer opponents ships before the computer destroys all of the players ships placed on the playing grid. FIT9131 Semester 2 2018 Assignment 2 19 September 2018 2 The game will allow the player to place a number of ships onto the playing grid based on x and y coordinates entered by the user. The computer opponent will also do the same randomly. Each ship will only occupy a single coordinate, as such, two ships cannot be placed at the same set of coordinates. To keep things interesting, each ship when places is given a random number between 1 – 5 which indicates its overall strength. This means that the same ship has to be hit that many times in order for it to be destroyed. Once a ship has been destroyed it is taken out of play on the grid. Each hit on a ship get points for the player or the computer. The game ends when all the ships are destroyed. Game play The following section outlines the game play for each of the involved participants. Round Number FIT9131 Semester 2 2018 Assignment 2 19 September 2018 3 Player and Computer Score Player Grid Player Ship Computer Grid Computer Ships Hidden FIT9131 Semester 2 2018 Assignment 2 19 September 2018 4 The Playing Grid The playing grid will be of a fixed size for the duration of the game. On starting the game, the game will load the following preferences from a file called “gamesettings.txt”. Grid Width and Height: 5 Multiple Hits Allowed: true Computer Ships Visible: false No of Ships : 3 The file will represent this default data as follows: 5,true,false,3 Your program must work based on the parameters specified in this file. (Note: default values not used) Manoeuvring the Grid: To move the various elements along the grid, the grid is to be represented as coordinates. Each position on the grid is given a coordinate in the format x,y. No two ships can occupy the SAME coordinate at any given time. This is only applicable to each player. For e.g. the player can place a ship at 2,3 and the computer can place its ship at 2,3. But both the player and computer cannot place another ship at the same coordinate. The Grid The grid will use the following notation: ~ – to indicate water and an unoccupied grid. The computer ships until hit will also display this symbol. O – to indicate a player ship to the player if one is placed at those coordiantes D – a ship which has been hit at least once to indicate a damaged ship. X – a destroyed ship. The computer’s ships MUST be made visible or be hidden from the player based on the flag set in the settings file above. When the computer ships are hidden, the D and X status of each ship MUST be shown on screen when hit or destroyed. However undamaged ships are shown as ~ symbol. FIT9131 Semester 2 2018 Assignment 2 19 September 2018 5 Game Setup: After loading the game settings from the file, the system will then ask the user to enter the following information for each ship: 1. Ship Name – String between 3 and 15 characters long. 2. x Coordinate – X coordinate position between 0 and the maximum grid size from the settings file. 3. y Coordinate – y coordinate position between 0 and the maximum grid size from the settings file 4. If any coordinate is incorrect (e.g. alphabetic or outside range of grid) an error message should be displayed. The number of ships set is determined from the game settings file. After the player ships are set, the computer ships are automatically generated. Coordinate Validations FIT9131 Semester 2 2018 Assignment 2 19 September 2018
Oct 20, 2020FIT9131Monash University
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here