Question: Create a class named TestLease whose main ( ) method declares four Lease objects named lease1, lease2, lease, and lease. Create the TestLease class with
Create a class named TestLease whose main ( ) method declares four Lease objects named lease1, lease2, lease, and lease.
Create the TestLease class with a main() declaring four Lease objects.
Create a getData) method that prompts a user for values for each field for a Lease, and return a newly constructed Lease object to the main( ) method where it is assigned to one of main () 's first three Lease objects. Do not prompt the user for values for the fourth Lease object, but let it hold the default values.
Define the getData() method to return a new Lease object based on user provided input.
After the four Lease objects have been assigned values, pass the lease1 object to a showValues) method that displays the data.
The data should be displayed in the following format:
Your lease results:
Name. : Jane Doe
Apartment: 21
Rent: 1654.0
Term : 13
Then call the addPetFee() method with the leasel object, and confirm that the fee explanation statement is displayed. Next, call the showValues () method for the leasel object again and confirm that the pet fee has been added to the rent.
Finally, call the showValues ( ) method with each of the other three objects.
Confirm that two hold the values you supplied as input and one holds the constructor default values.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
