Question: QUESTION 2 (30 MINUTES) Write a Java class that takes three double values Height (b), Width 1 (h) and Width Withy) from the user and

QUESTION 2 (30 MINUTES) Write a Java class that takes three double values Height (b), Width 1 (h) and Width Withy) from the user and calculate the area of a trapezoid as shown in Figure 1 below. This class has a default constructor and all the variables will be given a default value of 1. Your code shall have 2 protected non static methods, one for calculation and one for the output. Ask the input via console input in main() method from different class which is from a different package and send the parameters via constructors. You may use this and super keyword Given the formula to calculate the area of a trapezoid is Display your output using window as shown below Height - 7.5, Width 1 = 3.3, Width 2 = 9.5 The area of a trapezoid is = 48.0 Tranezoid
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
