Outlab 6: Battleship

Due: Monday 25 April at 6 pm

Purpose

Apply everything you have learned this semester to solve a moderately sized problem (with many little sub-problems) with minimal guidance. i.e. Show me how well you can think for yourself.

Partners

This is an individual assignment, though collaboration (not solution sharing) is allowed.

Problem Statement

You will build an application that allows a person to play Battleship against the computer. I will provide you a Driver and a class to represent spots on the board. You must use what I provide and build your own class to represent the game. Your application will create the board, place ships randomly, ask the user for spots they want to shoot at, report/update the result, and repeat until the game is over (all ships are hit in each spot they occupy). You must also be able to report the number of guesses it took the user to finish the game. There will also be limited error checking as described below.

Assignment

Hints

Submission

By Monday 25 April at 6 pm, submit the file Battleship.java into the appropriate D2L dropbox folder. DO NOT SUBMIT .class files!

Grading - 20 points