A. 1. Create a class named Lease with fields that hold an apartment tenant’s name, apartment number, monthly rent amount, and term of the lease in months. 2. Include a constructor that initializes the name to “XXX”, the apartment number to 0, the rent to 1000, and the term to 12. 3. Include methods to get and set each of the fields. 4. Include non-static method named addPetFee() that adds $10 to the monthly rent value and calls a static method names explainPetPolicy() that explains the pet fee. Save the class as Lease.java B. 1.Create a class named TestLease whose main() method declares four Lease objects. 2 Call a getData() method three times. 3.Within the method, prompt the 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 4.Do not prompt the user for values for the Lease object, but let it continue to hold the default values. 5.In the main(), pass one of the Lease objects to a showValues() method that displays the data 6.Call the addPetFee() method using the passed Lease object and confirm that the fee explanation statement is displayed. 7.Call the showValues() method for the Lease object again and confirm that the pet fee has been added to the rent 8.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. Save the application as TestLease. java

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
A. 1. Create a class named Lease with fields that hold an apartment tenant’s name, apartment number, monthly rent amount, and term of the lease in months. 2. Include a constructor that initializes the name to “XXX”, the apartment number to 0, the rent to 1000, and the term to 12. 3. Include methods to get and set each of the fields. 4. Include non-static method named addPetFee() that adds $10 to the monthly rent value and calls a static method names explainPetPolicy() that explains the pet fee. Save the class as Lease.java B. 1.Create a class named TestLease whose main() method declares four Lease objects. 2 Call a getData() method three times. 3.Within the method, prompt the 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 4.Do not prompt the user for values for the Lease object, but let it continue to hold the default values. 5.In the main(), pass one of the Lease objects to a showValues() method that displays the data 6.Call the addPetFee() method using the passed Lease object and confirm that the fee explanation statement is displayed. 7.Call the showValues() method for the Lease object again and confirm that the pet fee has been added to the rent 8.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. Save the application as TestLease. java
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY