(SOLVED)Question Answered step-by-step Java Question: Java Shape program with 2 abstract classes: - TwoD -...
Question Answered step-by-step Java Question: Java Shape program with 2 abstract classes: - TwoD -... Java Question: Java Shape program with 2 abstract classes: - TwoD - Three D Class TwoD consists of Class Circle, Rectangle, Triangle and Trapezoid. Class ThreeD consists of Class Cube, Tetrahedron and Sphere. Superclass TwoD implements OnlyTwoD and Shape as Interface. Superclass ThreeD implements OnlyThreeD and Shape as Interface. The main method randomly generates an integer K (0 or 1 or 2). - If k is 1, a TwoD object is constructed. - If k is 2, a ThreeD object is constructed. - If k is 0, the task will end. The shapes are randomly generated and stored in an ArrayList which the ArrayList also displays the output of the program.
Written for
- Institution
- American Public University
- Course
- JAVA
Document information
- Uploaded on
- October 31, 2022
- Number of pages
- 12
- Written in
- 2022/2023
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
-
question answered step by step java question java shape program with 2 abstract classes twod