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
How do you insert text into a presentation?
ElenaW [278]

Answer:

Its most likely the last one

Explanation:

But like, what kind of quesiton is this?

7 0
3 years ago
Read 2 more answers
IANA has primarily been responsible with assigning address blocks to five regional internet registries (RIR). A tech needs to re
VikaD [51]

Answer:

The American Registry for Internet Numbers ARIN

Explanation:

The American Registry for Internet Numbers (ARIN) is a not for profit organization that serves as the administrator and distributor of Internet numeric resources such as IP addresses (IPv4 and IPv6) ASN for the United States, Canada, as well as North Atlantic and Caribbean islands

There are four other Regional Internet Registry including APNIC, RIPE NCC, LACNIC and AFRINIC.

6 0
3 years ago
A student has a ten-year-old desktop computer that she only uses for word processing, but she would like to start using it to pl
wariber [46]

Answer:

She should buy a new one or buy a Gaming PC to upgrade the setup.

Explanation:

6 0
3 years ago
There used to be a popular type of pulp book for younger readers. They were called "Choose Your Own Adventure" novels. The idea
Art [367]

Answer:

i dont know

Explanation:

5 0
3 years ago
1. What do you think of the use of Moore’s Law to hypothesize a timeframe for the origin of life?
KATRIN_1 [288]

Answer:

Moore's Law refers to Moore's perception that the number of transistors on a microchip doubles every two years, though the cost of computers is halved. Moore's Law states that we can expect the speed and capability of our computers to increase every couple of years, and we will pay less for them. Another tenet of Moore's Law asserts that this growth is exponential.

5 0
3 years ago
Read 2 more answers
Other questions:
  • NEED HELP ASAP!
    13·1 answer
  • In a java class, variables can be present both inside and outside of methods. question 9 options:
    7·1 answer
  • Who was eqvtime tayaishvili?​
    13·2 answers
  • What is the maximum number of VLANs that can be configured on a switch supporting the 802.1Q protocol? Why?
    11·2 answers
  • ____________ is a script or a tool that obtains privileges of a root
    8·1 answer
  • Consider the following program segment. ifstream inFile; //Line 1 int x, y; //Line 2 ... //Line 3 inFile >> x >> y;
    15·1 answer
  • Which of the following statements best compares and contrasts the role of editors in a television news room and editors at a new
    5·1 answer
  • How much would it cost to get the screen replaced on a Moto G7?
    10·1 answer
  • A. All methods in an interface must be _________________ _________________________.
    5·1 answer
  • What is an advantage of using a fully integrated cloud based data analytics platform
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!