Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Upload four java files here based on the instructions provided in the attached worksheet: * FishBot class (called FishBot.java) * Updated SharkBot class (called SharkBot.java)

image text in transcribedimage text in transcribed

Upload four java files here based on the instructions provided in the attached worksheet: * FishBot class (called FishBot.java) * Updated SharkBot class (called SharkBot.java) * Updated MinnowBot class (called MinnowBot.java) * MegaSharkBot class (called MegaSharkBot.java)

APCS A Abstract Class HW Name Date Period 1) Below are two classes, SharkBot and MinnowBot: public class SharkBot extends Better TurnerBot { Il constructor not shown public void eat() { findFood; pickBeeper(); } public class MinnowBot extends Better TurnerBot { // constructor not shown public void eat() { findFood(); pickBeeper(); } // precondition: SharkBot is at a location that // contains 2+ beepers private void pickBeeper() { super.pickBeeper(); super pickBeeper(); } // finds a beeper public void findFood { // implementation not shown (though different // from SharkBot's findFood) } // finds a beeper public void findFood { // implementation not shown (though different // from MinnowBot's findFood) } public void flee() { move(); move(); move(); move(); move(); } } public void move) { super.move(); super.move(); } } Based on our discussion on abstract classes, create an abstract class called FishBot that abstracts out the common code from SharkBot and MinnowBot. Edit your SharkBot and MinnowBot classes to appropriately represent the inclusion of this abstract class (by creating abstract methods as appropriate and removing methods with identical implementation) as well as represent a more appropriate inheritance hierarchy. public abstract class FishBot extends { 2) A MegaSharkBot is a SharkBot that moves twice as fast and eats twice as much as a SharkBot does. With this information, write the complete MegaSharkBot class. APCS A Abstract Class HW Name Date Period 1) Below are two classes, SharkBot and MinnowBot: public class SharkBot extends Better TurnerBot { Il constructor not shown public void eat() { findFood; pickBeeper(); } public class MinnowBot extends Better TurnerBot { // constructor not shown public void eat() { findFood(); pickBeeper(); } // precondition: SharkBot is at a location that // contains 2+ beepers private void pickBeeper() { super.pickBeeper(); super pickBeeper(); } // finds a beeper public void findFood { // implementation not shown (though different // from SharkBot's findFood) } // finds a beeper public void findFood { // implementation not shown (though different // from MinnowBot's findFood) } public void flee() { move(); move(); move(); move(); move(); } } public void move) { super.move(); super.move(); } } Based on our discussion on abstract classes, create an abstract class called FishBot that abstracts out the common code from SharkBot and MinnowBot. Edit your SharkBot and MinnowBot classes to appropriately represent the inclusion of this abstract class (by creating abstract methods as appropriate and removing methods with identical implementation) as well as represent a more appropriate inheritance hierarchy. public abstract class FishBot extends { 2) A MegaSharkBot is a SharkBot that moves twice as fast and eats twice as much as a SharkBot does. With this information, write the complete MegaSharkBot class

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

Step: 3

blur-text-image

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

More Books

Students also viewed these Databases questions

Question

Practice what you preach.

Answered: 1 week ago