Question: 1. Using object-oriented programming approach, write a Java program that computes and outputs the area of the shaded region in the diagram. Define a class
1. Using object-oriented programming approach, write a Java program that computes and outputs the area of the shaded region in the diagram. Define a class Circle (Circle.java) o One private data member: radius; o Two overloaded constructors; o Get and set methods for the private data member o Method computeArea which computes and returns the area, Method computeCircumference which computes and returns the circumference o o toString0 method. - Define a class Trapezoid (Trapezoid.java) o Three private data members: basel, base2, and height; o Two overloaded constructors; o Get and set methods for each private data member o Method computeArea which computes and returns the area; o toString0 method. - (ShadedRegion.java) Write the client class that inputs a radius, a basel, a base2, and a height, then creates a Circle object and a Trapezoid object based on the user input, then uses these two objects to compute andd output the shaded area (you can assume that the circle is smaller enough to fit inside the trapezoid)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
