Question: Using C++ classes for a one sided battleship game in which the ships are 1 space in width and length, what would the code look

Using C++ classes for a one sided battleship game in which the ships are 1 space in width and length, what would the code look like for the following pseudocode concerning the main()

 declare an object of class fleet call deployFleet() method on it prompt the user if ships' positions and status need to be printed loop while method operational() returns true - i.e. at least one ship is not sunk. Inside the loop, declare an object of class location, invoke fire() on it to get the location of the user's shot, pass this object to isHitNSink() method of your fleet object analyze the return value of this method and report a hit or a miss if requested printing ships' status invoke printFleet() 

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!