Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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:

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing Fundamentals, Design, and Implementation

Authors: David M. Kroenke, David J. Auer

14th edition

133876705, 9781292107639, 1292107634, 978-0133876703

More Books

Students also viewed these Databases questions

Question

How do Excel Pivot Tables handle data from non OLAP databases?

Answered: 1 week ago