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
Get step-by-step solutions from verified subject matter experts
