The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Jul 2017 |
| Last Sign in: | 304 Weeks Ago, 4 Days Ago |
| Questions Answered: | 15833 |
| Tutorials Posted: | 15827 |
MBA,PHD, Juris Doctor
Strayer,Devery,Harvard University
Mar-1995 - Mar-2002
Manager Planning
WalMart
Mar-2001 - Feb-2009
Make a LandTractclass with the following fields:
Â
• length - anint containing the tract's length
• width - anint containing the tract's width
Â
Theclass should also have the followingmethods :
Â
• area - returns anint representing the tract's area
•equals - takes another LandTractobject as aparameter and returns aboolean saying
whether or not the two tracts have the same dimensions (This applies regardless ofwhether 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 havingequal dimensions.)
• toString - returns aString with details about the LandTractobject in the format:
LandTractobject with length 30 and width 40
(If, for example, the LandTractobject had a length of 30 and a width of 40.)
Â
Write a separateprogram 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). Theprogram should print theoutput of two tracts' toStringmethods followed by a sentence statingwhether or not the tracts haveequal 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 threestatements on separate lines.
----------- Â ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly