Question: PLEASE do this in java. Please provide a screenshot of code as well. Create a class named TestLease whose main() method declares four Lease objects.

PLEASE do this in java. Please provide a screenshot of code as well.

Create a class named TestLease whose main() method declares four Lease objects. Call a getData() method three times. Within the method, prompt a user for values for each field for a Lease, and return a Lease object to the main() method where it is assigned to one of main()s Lease objects. Do not prompt the user for values for the fourth Lease object, but let it continue to hold the default values. Then, in main(), pass one of the Lease objects to a showValues() method that displays the data. Then call the addPetFee() method using the passed Lease object and confirm that the fee explanation statement is displayed. Next, call the showValues() method for the Lease 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.

Sample output:

PLEASE do this in java. Please provide a screenshot of code as

Enter lessee name >> John Doe Enter apartment number >> 101 Enter rent >> 1000 Enter lease term in months >> 12 Enter lessee name >> Pete Smith Enter apartment number >> 201 Enter rent >> 1200 Enter lease term in months >> 12 Enter lessee name >> Brian Dee Enter apartment number >> 204 Enter rent >> 800 Enter lease term in months >> 2 Your lease results: Name : John Doe Apartment : 101 Rent : 1000.0 Term : 12 A pet fee of $10 is addd to the monthly rent. Your lease results: Name : John Doe Apartment : 101 Rent : 1010.0 Term : 12 Your lease results: Name : Pete Smith Apartment : 201 Rent : 1200.0 Term : 12 Your lease results: Name : Brian Dee Apartment : 204 Rent : 800.0 Term : 2 Your lease results: Name : XXX Apartment : 0 Rent : 1000.0

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!