Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribedUsing 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 too

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Accidental Data Scientist

Authors: Amy Affelt

1st Edition

1573877077, 9781573877077

More Books

Students also viewed these Databases questions