Class Description: Your need to create an instantiable class that represents a parcel of raw land that can be sold by a real estate company. This class should be named Land. It will contain three fields: a string named location and a width and length, measured in feet, each of which can accept numbers with decimal points. You may assume that every parcel of land is rectangular and that 'width' describes the size of the property along the road and 'length' is how far back it goes from the road. The class needs one constructor that sets the values all the fields. The class needs the following public methods: • Getters and setters for all fields. • A method called getArea that calculates and returns the area of the parcel of land in square feet. (Area is calculated as length x width.) • Standard methods: toString, equals, and hashCode where equals and hashCode define two equivalent parcels of land as each having the same length and each having the same width. • Implementation of the Comparable interface, comparing area.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter10: Introduction To Inheritance
Section: Chapter Questions
Problem 1GZ
icon
Related questions
Question

JAVA CODE 

Class Description: Your need to create an instantiable class that represents a parcel of raw land that can be sold by a real estate company. This class should be named Land. It will contain three fields: a string named location and a width and length, measured in feet, each of which can accept numbers with decimal points. You may assume that every parcel of land is rectangular and that 'width' describes the size of the property along the road and 'length' is how far back it goes from the road. The class needs one constructor that sets the values all the fields. The class needs the following public methods:

• Getters and setters for all fields.

• A method called getArea that calculates and returns the area of the parcel of land in square feet. (Area is calculated as length x width.)

• Standard methods: toString, equals, and hashCode where equals and hashCode define two equivalent parcels of land as each having the same length and each having the same width.

• Implementation of the Comparable interface, comparing area.

Create a new NetBeans project and create the Land class with all the fields, constructors, and methods listed. Then create a JUnit test file for this class. It is your job to determine what makes sense to test and what values to use in order to thoroughly test the class’s methods. 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 7 images

Blurred answer
Knowledge Booster
Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,