Reference no: EM132333553
Assignment - Implementation in Java
The game will be implemented with text prompts, standard output, and an ASCII-art drawing to represent the game progress for the human player. No such representation is needed for the artificial player, as they are the opponent.
Initially when the game starts, there is a welcome message, an empty target grid and automatically populated ocean grid for the human player, and a prompt for the human player to make their first guess. This is shown in attached file.
The game proceeds with the human and artificial players making their guesses in an alternating fashion, until either player has hit all positions of all ships of the opponent. For example, the sample game shown below (after 7 turns have passed) suggests that the human player might have made 3 hits against a length-3 ship, and the artificial player has made one hit against a cruiser.
Task overview -
You are required to complete the tasks in the order below. Do not start a task until the preceding tasks are finished.
Tasks 1-4: UML
Create a complete UML class diagram in Visio 2016 for the Battleship Game. Marks will be awarded for the packages (Task 1) classes (Task 2), enumeration (Task 3) and relationships (Task 4). The marking rubric below gives more details about the components we are expecting.
Task 5: Test scenario 1
Fill in a copy of the test case template (from the Learning Portal) for the test scenario of placing a fleet of ships with one ship only (the Aircraft Carrier, length 5) for the Player.placeFleet() method.
This test scenario must cover the following test cases that generate valid outcomes:
1. Place the ship horizontally.
2. Place the ship vertically.
... and the following test cases that generate invalid outcomes:
3. Place the ship before the start of the grid.
4. Place the ship after the end of the grid.
5. Place the ship such that it is partially in the grid and partially outside of the grid.
Task 6: Test scenario 2
Fill in another copy of the test case template (from the Learning Portal) for the test scenario of placing a fleet of ships with two ships only (the Aircraft Carrier, length 5, and the Battleship, length 4) for the Player.placeFleet() method.
The test scenario must cover a minimum of two test cases that you design yourself. At least one test case must represent a valid outcome and at least on test case must represent an invalid outcome.
Tasks 7-12: Implementation
Implement the BattleshipGame program as a NetBeans 8.2 project using Java 8. Your solution must also include the following general features:
a) Error handling for user input.
b) Consistent code indentation with one level of indentation per block.
c) Code commenting for each class, all methods, and some inline comments.
d) Good naming conventions.
Attachment:- Java Assignment File.rar