Question: c++ please Now we'll write another class botbleShip. If you're not familiar with the game, it might helpful to go read up on it before

c++ pleasec++ please Now we'll write another class botbleShip. If you're not familiar

Now we'll write another class botbleShip. If you're not familiar with the game, it might helpful to go read up on it before doing this question https://en.wikipedia.org/wiki/Battleship (eame) class battleship public battleship(string); battleshipO void setshipNane(string); string getshipNanc oid setsize(int) int getsize) void recordHit:1 Increrents the hits data member bool isSunk) 1/ returns true if hits is greater than equal to size private string nane int size; int hits 3 For this question, we've provided a complete class definition in the coderunner box. Write the function definitions for all 8 member functions of the battleShip class. The constructor battleShip(string) takes the ship name and should set all the data members of the ship to the correct value. The default size of a ship should be-1. What should hits be set to for a new ship? The function recordHit) should print "cnamex has been hit chits> times. For example, if a ship named-Carrier" with size 5 had 4 hits. I would expect the output Carrier has been hit 4 times. The function isSunk0 should print "

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!