Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask DBMS Expert


Home >> DBMS

Programming Assignment- Battleship Refactor

Refactor your Battleship drawing code from Module 1.

Download the OO template for the basic battleship game, BattleshipRefactor.zip.

The template has the outline of a battleship game using OO constructs. You need to add the Grid class and complete the code so that it runs correctly.

At a minimum, you need to complete the Draw and DropBomb methods with code similar to the previous assignment. There will be changes due to the different layout, but the core of your code will do the same thing.

In this Module we are adding 2 new features:

1. Variable sized grid ­ the trivial part of this is making a 2D array based on the passed in size. The second part is adding some ships to that grid ­ we cannot use the constant array from Module 1. You need to come up with a very simple algorithm to add a few ships to the grid. This is purely test code so it doesn't have to be sophisticated in any way (there is time for that later in the class). If you can't think of any ways ask in the forums. Do not ask the user (your teacher) for input to place these ships.

2. Game over detection - This will be implemented in the readonly property Grid.HasShipsLeft. In this property you will determine if there are any ships left not hit with a bomb. The algorithm should look through the array for any remaining ships each time the property is read.

You may add as many other methods, fields or properties as you feel are required for the assignment.

Notes:

The code will be tested with grids ranging in size from 5 (the smallest you can fit a size 5 ship) upwards. Make sure that all aspects of the game work correctly without crashing or hanging.

You must use the template code provided!

Like in Module 1, Make sure you show the ships in the grid. At this point we are merely testing our game logic and hidden ships make the game very hard to test.

Attachment:- Battleship-Refactor.zip

DBMS, Programming

  • Category:- DBMS
  • Reference No.:- M92746796

Have any Question?


Related Questions in DBMS

Data mining assignment -in this assignment you are asked to

Data Mining Assignment - In this assignment you are asked to explore the use of neural networks for classification and numeric prediction. You are also asked to carry out a data mining investigation on a real-world data ...

Football association of zambia faz super leaguethe faz has

Football Association of Zambia (FAZ) Super League The FAZ has recently decided to reorganise their operations to support both existing and possibly expanded league operations in Zambia and part of preparation for the 201 ...

The groceries datasetimagine 10000 receipts sitting on your

The groceries Dataset Imagine 10000 receipts sitting on your table. Each receipt represents a transaction with items that were purchased. The receipt is a representation of stuff that went into a customer's basket. That ...

Assignmentqueries functions and triggersdatabase

Assignment Queries, Functions and Triggers Database Systems Aims The aims of this assignment are to: formulate SQL queries; populate an RDBMS with a real dataset, and analyse the data; design test data for testing SQL qu ...

Question lab 1 creating a database designthis assignment

Question: Lab 1: Creating a Database Design This assignment contains two (2) Sections: Database Design Diagram and Design Summary. You must submit both sections as separate files in order to complete this assignment. Not ...

Question create an erd for the following scenarioa small

Question: Create an ERD for the following scenario. A small company ABC wants a database to keep track of internal company information. Â Given the following information create an ERD. The ABC Company has several departm ...

Backgrounda new training organization called abc

Background A new training organization called ABC TechTraining is opening soon and they have approached you to help design their new database. They have just completed the refurbishment of the premises and are now lookin ...

Query 1 the bookstore has decided to keep track of the

Query 1: The bookstore has decided to keep track of the vendors' information. In order to do this, one new table will be added to the database. The schema for this table, as related to the existing tables, is the followi ...

Sqlwrite a select statement that returns one column from

SQL Write a SELECT statement that returns one column from the Vendor table named Full Name. Create this column from the VendorContactFName and VendorContactLName columns. Format it as follows: last name, comma, first nam ...

Question 1 unified communications system eg email

Question: 1. Unified Communications System (e.g., email, conferencing, and messaging) - The local area network is slower than needed, especially for newer, cloud-based applications. The email system needs refurbishment a ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As