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
It takes you 0.8 of a minute to read each page of your health book. It takes you 5.5 minutes to take the test at the end. How lo
NeTakaya
The answer would be 13.3125 because 6.25 / 0.8 is 7.8125 than add 5.5 which will equal 13.3125. I'm sure about this.
7 0
2 years ago
Read 2 more answers
Proszę daje wszystko potrzebuje tego
Stolb23 [73]
I’m sorry I do not speak that
5 0
3 years ago
Read 2 more answers
Energy vampire devices can draw power even when they are turned off or in standby mode?
just olya [345]
Yes that is correct.
3 0
3 years ago
A ____ is an e-mail attack in which the attacker routes large quantities of e-mail to the target system hoping to overwhelm the
GarryVolchara [31]

Answer:

Mail bomb is the correct answer.

Explanation:

In the following statement, A mail bomb is the type of attack on e-mail of the particular person by which the attacker transfers large quantities of e-mail to the target computer in the expectation of flooding the target with so much meaningless e-mail that legitimate e-mail is not accessible. So, that's why the following answer is correct.

3 0
2 years ago
Aye yo, how do I get rid of an already placed end crystal? I thought it looked cool to build in my minecraft survival house, and
SpyIntel [72]

Answer:

they can be removed safely if they're immersed in water first.

Explanation:

8 0
3 years ago
Read 2 more answers
Other questions:
  • A. True
    8·2 answers
  • I have a bag of trail mix.half of the bag contains peanuts.1/4of the bag is chocolates candies, and 1/4of the bag is dried fruit
    12·2 answers
  • All but one of the following statements about stored procedures is true. Which one is false? a. They consist of one or more SQL
    10·1 answer
  • What are the guided and unguided transmission media and what are the differences?
    15·1 answer
  • The region which satisfies all of the constraints in graphical linear programming is called the:
    8·1 answer
  • Explain the use of keyboard shortcuts and key combinations. You are at the tenth page of a 20-page document. You need to make ch
    14·1 answer
  • What is the statement describing? Agile team continuously adapt to new circumstances and enhance the methods of value delivery
    6·1 answer
  • Calvin needs to design a simple yet professional interface for his users. Which option should he implement?
    9·2 answers
  • Question #5
    15·2 answers
  • Como se llaman las herramientas y maquinas pque utilizan para hacer cosas artesanales
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!