Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Make a LandTract class with the following fields: length - an int containing the tract's length width - an int containing the tract's width The

Make a LandTract class with the following fields: length - an int containing the tract's length width - an int containing the tract's width The class should also have the following methods: area - returns an int representing the tract's area equals - takes another LandTract object as a parameter and returns a boolean saying whether or not the two tracts have the same dimensions (This applies regardless of whether the dimensions match up. i.e., if the length of the first is the same as the width of the other and vice versa, that counts as having equal dimensions.) toString - returns a String with details about the LandTract object in the format: LandTract object with length 30 and width 40 (If, for example, the LandTract object had a length of 30 and a width of 40.) Write a separate program that asks the user to enter the dimensions for the two tracts of land (in the order length of the first, width of the first, length of the second, width of the second). The program should print the output of two tracts' toString methods followed by a sentence stating whether or not the tracts have equal dimensions. (If the tracts have the same dimensions, print, "The two tracts have the same size." Otherwise, print, "The two tracts do not have the same size.") Print all three statements on separate lines.

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

Select Healthcare Classification Systems And Databases

Authors: Katherine S. Rowell, Ann Cutrell

1st Edition

0615909760, 978-0615909769

More Books

Students also viewed these Databases questions

Question

600 lb 20 0.5 ft 30 30 5 ft

Answered: 1 week ago

Question

1 What demand is and what affects it.

Answered: 1 week ago