Question: In Java Using the shape class, implement a random shape generator that for 7 seconds draws a new random shape every 100 milliseconds, no shape

In Java Using the shape class, implement a random shape generator that for 7 seconds draws a new random shape every 100 milliseconds, no shape can be drawn more than 10 times.

ThanksIn Java Using the shape class, implement a random shape generator that

Using your shape class . o Add an abstract draw(Graphics g) method to your abstract Shape class Create a Rectangle, Oval, Triangle, Pentagon & Hexagon class that are all extended from an abstract Shape class (given below). Extend the Rectangle class to make a Square class. Extend the Oval 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 different All extended classes should also implement a toString method-it is up to you how you want to represent the Shape as a String All extended classes should also implement a equals method to compare two shapes The Oval, Circle, Triangle, Rectangle, Square, Hexagon and Pentagon classes should have the same number of constructors with the same arguments, in addition to any other fields that are needed to create those shapes o o o o 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 the same class implementing are not directly accessible in the subclasses as if you were in Then initialize fields specific to the particular Shape class you are If done correctly the Square classes will have the least amount of code because it can reuse most of the Rectangle class methods. Similarly Circle class should reuse code from Oval class. o Hint: use super class constructors correctly and all this class should have is constructors and a toString method Using your classes, implement the Random Shape Generator application which runs for 7 seconds and draws one random shape every 100 milliseconds. No shape can be drawn more than 10 times. Write Junit tests for testing toString and equals methods Other requirements are: o o o o o Your background should be random color than black Shapes should be of random sizes Shapes should be of random colors different than background Shapes should be drawn in random locations Shapes may overlap a little bit but try to avoid overlaps that hide half of any

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!