Question
Make classes Circle, Square, an Abstract Class,and Triangle extend the Abstract Class, GeoShapes using actions for Geoshapes Project. Actions for Geoshapes Project (1) Abstract (Parent)
Make classes Circle, Square, an Abstract Class,and Triangle extend the Abstract Class, GeoShapes using actions for Geoshapes Project. Actions for Geoshapes Project (1) Abstract (Parent) Class Geoshapes - Created an abstract Class named Geoshapes - Copied into the Geoshapes Class the Class variables used by all of the child classes (did not copy dimension vars) Change scope (private to none) int xPosition; int yPosition; String color; boolean isVisible; - Copied into the Geoshapes Class the methods with code used by all of the child classes that were defined the same void makeVisible() void makeInvisible() void moveRight() void moveLeft() void moveUp() void moveDown() void moveHorizontal(int distance) void moveVertical(int distance) void slowMoveHorizontal(int distance) void slowMoveVertical(int distance) void changeColor(String newColor) void erase() Did not copy constructor methods in child classes - Copy signature line of methods that require unique definition in child Classes into Geoshapes and make abstract. (Modify the scope) abstract void changeSize(int dimension); // changesize is overloaded = 2 versions abstract void changeSize(int hdimension, int vdimension); abstract void draw(); void erase(); (2,3,4) Extended Child Classes: Circle, Square, Triangle - Make the child class extend the abstract-parent Class Geoshapes Allows the child class to inherit all methods defined methods defined (with code between {}) in the abstract-parent - Keep Class Variables that are different between classes (dimensions) Modify the scope (private to none) Eliminate those those class variable that are shared int xPosition; int yPosition; String color; boolean isVisible; - Remove all methods for which code is inherited from the parent class void makeVisible() void makeInvisible() void moveRight() void moveLeft() void moveUp() void moveDown() void moveHorizontal(int distance) void moveVertical(int distance) void slowMoveHorizontal(int distance) void slowMoveVertical(int distance) void changeColor(String newColor) void erase() - Keep contructor methods in the child class - Keep code for methods in the child class that are different (dependent on geometry)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started