1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Georgia [21]
3 years ago
13

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. Include a constructor that initializes the name to "XXX", the apartment number to 0, the rent to 1000, and the term to 12. Also include methods to get and set each of the fields. Include a nonstatic method named addPetFee() that adds $10 to the monthly rent value and calls a static method named explainPetPolicy() that explains the pet fee. Save the class as Lease.java.
Computers and Technology
1 answer:
natka813 [3]3 years ago
6 0

Answer:

package b4;

public class Lease {

// Declare the necessary instance fields

String tenant_name;

int appartment_number;

double rent_amount;

double lease_term;

// Constructor to initialize the fields to the requested values

public Lease() {

 this.tenant_name = "XXX";

 this.appartment_number = 0;

 this.rent_amount = 1000;

 this.lease_term = 12;

}

// Getter for tenant name

public String getTenant_name() {

 return tenant_name;

}

// Setter for tenant name

public void setTenant_name(String tenant_name) {

 this.tenant_name = tenant_name;

}

// Getter for appartment number

public int getAppartment_number() {

 return appartment_number;

}

// Setter for appartment number

public void setAppartment_number(int appartment_number) {

 this.appartment_number = appartment_number;

}

// Getter for rent amount per month

public double getRent_amount() {

 return rent_amount;

}

// Setter for rent amount per month

public void setRent_amount(double rent_amount) {

 this.rent_amount = rent_amount;

}

// Getter for lease term

public double getLease_term() {

 return lease_term;

}

// Setter for lease term

public void setLease_term(double lease_term) {

 this.lease_term = lease_term;

}

// Non-static method addPetFee

// It adds $10 to the current rent_amount.

// It also calls the static explainPetPolicy method

public void addPetFee() {

 this.rent_amount += 10;

 explainPetPolicy();

}

// The Static explainPetPolicy method

// Please replace the string in the println() method with the actual policy

// statement

public static void explainPetPolicy() {

 System.out.println("Explanation of the pet policy is as follows");

}

}

Explanation:

The actual source code file has been attached to this response. The code has been well commented to aid readability and understandability. Please download the file attached. It has been saved as "Lease.java"

Download java
You might be interested in
Design a function that checks if a keyword exists in a given keyword tree and returns true if so and returns false otherwise. Af
jeka57 [31]

Answer:

Explanation:

N

7 0
3 years ago
Read 2 more answers
What will allow you to purchase software without receiving full rights to the program?
mihalych1998 [28]

Answer:

i need free points cus i have zero sry

Explanation:

7 0
4 years ago
The measure of how quickly things may be converted to something of value is called.
Airida [17]

Answer:

liquidity. is a measure of how quickly things can be converted to something of value like cash. commodity money. based on some item of value.

Hope this helps! If so please mark brainliest and rate/heart to help my account if it did!!

3 0
3 years ago
Read 2 more answers
The PICC team is scheduled to remove a PICC before client discharge. Assessment of the catheter indicates the PICC and determine
Alik [6]

Answer:

Stuck PICC is one potential complication, and it occurs when the catheter is not able to disengage while the removal process, and it cannot be removed out of the vein. And this is generally due to venospasm and it gets resolved as the time passes.

Explanation:

You should know that PICC stands for Peripherally inserted central catheter, and it is a thin, delicate and long tube or catheter, which is inserted inside the vein in the child's arm, neck or leg. And the tip of the catheter is being positioned inside a large vein which carries the blood inside the heart. A PICC line is applied for long-term intravenous antibiotics, medication or nutrition, and for drawing the blood.

4 0
3 years ago
When you hear the word “stress” what does it mean to you? How does stress affect you and what do you do to cope with stress
stepan [7]

   Ways to Cope with  Stress

  • Re-balance Work and Home.
  • Build in Regular Exercise.
  • Eat Well and drink lots of water.
  • Connect with Supportive People.
  • Carve out Hobby Time.
  • Practice Meditation, Stress Reduction or Yoga.
  • Sleep Enough.
  • Bond with Your Pet.

 

hope it helps! :)

3 0
3 years ago
Other questions:
  • It is not recommended by the USA EPA, but adding refrigerant to a leaking A/C system is
    13·1 answer
  • A network administrator is implementing dhcpv6 for the company. the administrator configures a router to send ra messages with m
    6·1 answer
  • Many companies use software to scan resumes and search for _____________.
    10·1 answer
  • A typical self-expelling fire extinguisher empties its contents in
    8·1 answer
  • What is the internet?
    5·2 answers
  • The chemical symbol H represents which of the following elements?
    9·2 answers
  • HELP PLS!!! In a presentation, what is layout?
    10·2 answers
  • My phone takes forever to load the ads, does anyone else have this problem? Is there a way to fix it? I’ve tried getting another
    12·2 answers
  • What is the difference between turn-based game mode and point-based game mode?
    15·1 answer
  • ____ characterized the period now known a Web 1. 0. Augmented reality
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!