Question: Java Q4 You need to implement a program that draws different figures based on user choice. You need to implement the following class hierarchy Shape
Q4 You need to implement a program that draws different figures based on user choice. You need to implement the following class hierarchy Shape Oval Square Triangle Shape is an abstract class that has draw as an abstract class, draw takes the index of the shape in the array of shapes. Each other class (Oval, Square, Triangle) implements draw and calculates the starting position of index. In the test class promote the user to enter the number of requested shapes of each type. Then creates the requested number of each shape type and save them in an array. In a for loop it draws each shape Sample Output: Number of Ovals: 2 Number of Triangles: 2 Number of Squares: 3 the shape using the provided
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
