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
Least common multiple of 78,90, and 140
Daniel [21]
The least common multiple (LCM) of 78, 90, and 140 is: 16,380

78 × 210 = 16,380
90 × 182 = 16,380
140 × 117 = 16,380
5 0
3 years ago
Read 2 more answers
PLEASE HELP!
ss7ja [257]

Explanation:

Case-sensitivity is inherently faster to parse (albeit only slightly) since it can compare character sequences directly without having to figure out which characters are equivalent to each other. It allows the implementer of a class/library to control how casing is used in the code.

3 0
2 years ago
In your own words! Give me an example of Digital Literacy? (50 words
iVinArrow [24]

Answer: See explanation

Explanation:

Digital literacy is when an individual can compose, find, and evaluate, a clear and composed information on digital platforms.

It involves possessing the skills that one need to live, and learn, through the use of digital platforms such as social media, mobile

Example of digits literacy is the use of search engines, understanding how web browser can be used or sending of emails. etc

3 0
3 years ago
Ted wants to share some information with his team. Match the levels of information with the content of the information that Matt
myrzilka [38]

The  Match up of the levels of information with the content of the information that Matt has shared are:

The nice to know - Ted makes an announcement of the total annual profit of the company.

The  should know - Ted gives his team a brief of the email etiquette for them to follow.

The  must know - Ted informs his team about the office work hours and dress code.

<h3>What do you mean by information?</h3>

Information is known to be data or any form of stimuli that connote a given meaning in some context to its receiver.

Hence, The  Match up of the levels of information with the content of the information that Matt has shared are:

The nice to know - Ted makes an announcement of the total annual profit of the company.

The  should know - Ted gives his team a brief of the email etiquette for them to follow.

The  must know - Ted informs his team about the office work hours and dress code.

Learn more about information from

brainly.com/question/4231278

#SPJ1

6 0
1 year ago
Consider the following code:
Elis [28]

Answer:

return tmp;

default:

tmp . token_type = ERROR;

return tmp;

1. In the code, input.GetChar() gets the next character from standard input. If GetToken() is called four times, which of the following inputs will return a token whose type is ERROR?

A. ========

A. =<======

B. ===>====

C. =====<==

D. ======<=

5 0
3 years ago
Other questions:
  • List five characteristics of a series circuit
    9·1 answer
  • What can a dimm use to hold data and amplify a signal just before the data is written to the module?
    12·1 answer
  • What is the purpose of copyfitting?
    12·1 answer
  • Which of the following is generally nota desire today's workers? A. computer ability B willingness to learn C. teamwork skills D
    8·1 answer
  • Write a function called lucky_sevens that takes in one #parameter, a string variable named a_string. Your function #should retur
    15·1 answer
  • An IT company revises its process parameters in response to complaints from vendors that products were not ready on time. This w
    15·1 answer
  • How many bits are required to encode an image that is 25 pixels wide and 50 pixels tall, if you encode each pixel with 12 bits o
    15·1 answer
  • What is 36 Denary in Binary?? PLEASE ANSWER I WILL GIVE U BRAINLY!!
    9·2 answers
  • Assume we are using the simple model for floating-point representation as given in this book (the representation uses a 14-bit f
    7·1 answer
  • What is the difference between the wiring configurations for a residential, 8-position, 8-contact (8P8C) modular plug and jack i
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!