Question
(1.)Make a LandTract class that has two fields:one of the tracts length and one for the width. The class should have a method that returns
(1.)Make a LandTract class that has two fields:one of the tracts length and one for the width. The class should have a method that returns the tracts area, as well as an equals method and toString method. Demonstrate the class in a program that asks the user to enter the dimensions for two tracts of land. The program should display the area of each tract of Land and indicate whether the tracts are of equal size. (2.)Design a Geometry class with the following methods:A static method that accepts the radius of a circle and returns the area of the circle with the formula: Area=r2,use Math.PI for and radius of the circle for r. A static method that accept the length and width of a rectangle and returns the area of the rectangle . Use the formula: Area = length*width.A static method that accepts the length of a triangle's base and the triangle's height.The method should return the area of the triangle . Use the formula:Area=Length*width.A static method that accepts the length of a triangle's base and the triangle's height .The method should return the area of the triangle . Use the formula:Area=base*height*0.5. The method should display error message if negative values are used for circle's radius, the rectangle's length or width or rectangle's length or width, or rectangles base or height. Next write a program to test the class , which displays the following menu and responds to the user's selection. Geometry calculator.Calculate the area of the circle ,calculate the area of a rectangle , calculate area of Triangle,Quit. Enter your choice(1-4),Display an error message if the user enters a number outside the range of 1 through 4 when selecting an item from menu. (3.)create two enums using the planet names and the names of the zodiac symbols. Also learn how to print the entire enum contents with a for (4.)Build a JavaDoc for one of the classes you built for this course.
Step 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