Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please make use of classes in c++ and don't ost the answer from the other similar question posted. Also, there needs to be a constructor

image text in transcribedimage text in transcribedPlease make use of classes in c++ and don't ost the answer from the other similar question posted. Also, there needs to be a constructor Battleship A. Thanks!

Finally, fill in the code for a play function that uses the battleShip class and runs a game of Battleship. Keep hitting all three ships until all three have been sunk, and always hit them in the order Destroyer, Carrier,then Cruiser void play) Cruiser //TODO: Declare 3 instances/objects of the battleship class: Destroyer Carrier /TODe: Give the ships a size: Destroyer-3 Carrier-5 Cruiser-2 // you will need to call the appropriate methods // Once you have this running for one, expand this while loop to include the // other two instances. Have the while loop end when all three ships have been // sunk. Make your while condition while ship one is sunk OR ship two is sunk OR ship three is sunk while(ship-one.isSunk() == false){ ship_one.recordHit); Finally, fill in the code for a play function that uses the battleShip class and runs a game of Battleship. Keep hitting all three ships until all three have been sunk, and always hit them in the order Destroyer, Carrier,then Cruiser void play) Cruiser //TODO: Declare 3 instances/objects of the battleship class: Destroyer Carrier /TODe: Give the ships a size: Destroyer-3 Carrier-5 Cruiser-2 // you will need to call the appropriate methods // Once you have this running for one, expand this while loop to include the // other two instances. Have the while loop end when all three ships have been // sunk. Make your while condition while ship one is sunk OR ship two is sunk OR ship three is sunk while(ship-one.isSunk() == false){ ship_one.recordHit)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts Of Database Management

Authors: Joy L. Starks, Philip J. Pratt, Mary Z. Last

9th Edition

1337093424, 978-1337093422

More Books

Students also viewed these Databases questions

Question

=+6. What does the invisible hand of the marketplace do?

Answered: 1 week ago

Question

=+ 4. Why should policymakers think about incentives?

Answered: 1 week ago