Question: *C PROGRAMMING* Demonstrate the ability to design a menu driven program, 2D arrays, strings, logic, thought, IO Program Specifications: The program will simulate a one

*C PROGRAMMING*

Demonstrate the ability to design a menu driven program, 2D arrays, strings, logic, thought, IO

Program Specifications:

The program will simulate a one player version of the classic game Battleship. The goal of this version is to sink all 5 ships using the lowest possible number of missiles.

The game is played on a 10 x 10 grid. The columns of the grid will be labeled A, B, C, D, E, F, G, H, I, and J. The rows of the grid will be numbered 1 10.

The 5 ships will be randomly placed on the game board. Neither the programmer nor the user will have any idea where the ships have been placed. The ships can be placed vertically or horizontally. All ships must be located within the 10 x 10 grid.

Game Play

The user will select a row and column combination and fire a missile. If the missile hits a ship the grid will display the letter H to indicate a ship was hit. The user will continue to fire missiles until all ships have been sunk. Once a ship has been sunk, the Hs will be replaced by the letters that represent the ship that has just been sunk.

Cruiser = 2 holes = C

Submarine = 3 holes= S

Destroyer = 3 holes = D

Battleship = 4 holes= B

Aircraft Carrier = 5 holes = A

As the game is played, somewhere on the screen the user will see how many missiles have been fired, the name of each ship that is still floating, and the name of each ship that has been sunk.

Other Rules

The game will have an option to display the past 10 best scores, therefore it will store the top best scores (lower score the better).

  • You will allow the user to see the top 10 scores.
  • You will allow the user to play the game.
  • You will allow the user to quit the game.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!