Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Using Java Create a project with a superclass named Shapes, and three subclasses named Trapezoid, Triangle, Parallelogram respectively. Given below are the formulas of the
Using Java
Create a project with a superclass named Shapes, and three subclasses named "Trapezoid, Triangle, Parallelogram respectively. Given below are the formulas of the area of the subclasses. (a+b) n 2 Trapezoid: A = Triangle: A = -bh Parallelogram: A = bh In the superclass, you need to write a program that reads in values for a, b and h. The subclasses will fetch the values from the superclass that is applicable to its formula. (Example: Triangle class will only get the value of b and h.) Each subclass will solve the area of their name (Example: Triangle class will solve the area of a triangle). And the superclass will call in all its subclasses and will be outputted all the areas. Remember to apply Abstraction and Encapsulation tooStep 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