Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can someone please do this assignment for me please thank you so much in advance. Review the resources included in the Explore section. Create a

Can someone please do this assignment for me please thank you so much in advance.

Review the resources included in the Explore section.

Create a class named Lease with attributes that hold an apartment tenants name, apartment number, monthly rent amount, and term of lease in months. Include a constructor that initializes the name to XXXXX, the apartment number to 0, the rent to 1000, and the term to 12. Include methods to get and set each of the fields. Include a nonstatic method assPetFee() that adds $10 to the monthly rent value and calls a static method named explainPetPolicy() to explain the pet fee. Save the class as Lease.java.

Create a driver class named TestLease. In the main method, declare four Lease objects. Create getData() method and call it three times. Within the method, prompt a user for values of each attribute for a Lease, and return a Lease object to the main method where it is assigned to one of the main ()s Lease objects. Do not prompt the user for the values for the fourth Lease object, but let it continue to hold the default values. Create a showValues(Lease ls) method, which displays the data the Lease object passed to the method as a parameter. For Lease1 object, call the addPetFee() method using the passed Lease object, and confirm that the fee explanation statement is displayed. Next, call the showValues() method with each of the other three objects; confirm that three hold the values supplied by users input and one holds the constructor default values. Save the application as TestLease.java.

Use Scanner of JoptionPane as a tool to accept users input. Make your application user friendly, providing the proper prompts informing a user what input data is expected and what results are being shown when the application runs.

A sample of Scanner-based application output might look as shown below:

image text in transcribed

Add the proper Header to the TestLease.java file. Do not forget to include the proper comments of the code statements in both .java files as internal code documentation. Create a UML class diagram of the application illustrating class hierarchy, collaboration, and the content of each class (include as a part of the MS .doc documentation below).

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

Making Databases Work The Pragmatic Wisdom Of Michael Stonebraker

Authors: Michael L. Brodie

1st Edition

1947487167, 978-1947487161

More Books

Students also viewed these Databases questions