Question
Q.1 Description (same for next three questions) Your job is to write an instantiable class that represents a parcel of raw land that can be
Q.1
Description (same for next three questions)
Your job is to write 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 two fields: 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 of the two 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.
Standard methods: toString, equals, and hashCode where equals and hashCode define an equivalent parcel of land as one with exact same the same dimensions.
Implementation of the Comparable interface.
------------------------------------------------------------------------------------------------
For this question, write a complete UML class diagram for this class. Use a line of minus signs to separate sections. Don't worry about drawing a box or centering any text. Do include all proper UML notation.
Q.2
Using the same information as in the previous question, create a NetBeans project named Exam2 and create the Land class with all the fields, constructors, and methods listed. Copy and paste the code for that class here.
Q.3
Write a JUnit class that tests the instantiable class. It is your job to determine what makes sense to test and what values to use in order to thoroughly test the classs methods.
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