Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

use java Using your shape class o Add an abstract draw(Graphics g) method to your abstract Shape class Create a Rectangle, Ellipse, and Triangle class

image text in transcribedimage text in transcribedimage text in transcribed

use java

Using your shape class o Add an abstract draw(Graphics g) method to your abstract Shape class Create a Rectangle, Ellipse, and Triangle class that are all extended from an abstract Shape class (given below). Extend the Rectangle class to make a Square class. Extend the Ellipse class to make a Circle class. The shape classes will contain state information for the object to be drawn All the different shapes will need a draw method but each one will be slightly o o All extended classes should also implement a toString method- it is up to o All extended classes should also implement a equals method to compare two o The Circle, Ellipse, Triangle, Square, and Rectangle should have the same number different you how you want to represent the Shape as a String shapes of constructors with the same arguments, in addition to any other fields that are needed to create those shapes To initialize the private instance fields of the Shape class you will need to make calls to the super class constructor. Private fields and methods of a super class are not directly accessible in the subclasses as if you were in the same class Then initialize fields specific to the particular Shape class you are implementing

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2015 Porto Portugal September 7 11 2015 Proceedings Part 3 Lnai 9286

Authors: Albert Bifet ,Michael May ,Bianca Zadrozny ,Ricard Gavalda ,Dino Pedreschi ,Francesco Bonchi ,Jaime Cardoso ,Myra Spiliopoulou

1st Edition

ISBN: 3319234609, 978-3319234601

More Books

Students also viewed these Databases questions