Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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 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
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