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
Combinations of spaces and special characters can be used in domain names of uniform resource locators (urls).
iris [78.8K]

A Uniform Resource Identifier (URI) is a compact sequence of characters that identifies an abstract or physical resource.

The statement that combinations of spaces and special characters can be used in domain names of uniform resource locators (URLs) is false. Correct answer: B

The specifications for URLs are clealy defined by The Internet Engineering Task Force (IETF).

7 0
3 years ago
Read 2 more answers
Related to Image Classification
loris [4]
<h3>Answers:</h3>

(1) Train the classifier.

(2) True

(3) Image Pre-processing

(4) Weakly Supervised Learning Algorithm

(5) SIFT (or SURF)

(6) True

(7) True

(8) True

(9) True

(10) Decision Tree Classifier

(11) Softmax


<h3>Explanations:</h3>

(1) In supervised learning, we have given labels (y) and we have input examples (X) which we need to classify. In Keras or in Scikit-learn, we have a function fit(X, y), which is used to train the classifier. In other words, you have to train the classifier by using the incoming inputs (X) and the labelled outputs (y). Hence, the correct answer is: The fit(X,y) is used to <em>train the classifier</em><em>. </em>

(2) This statement is primarily talking about the PCA, which stands for "Principal Component Analysis." It is a technique or method used to compress the given data, which is huge, into compact representation, which represents the original data. That representation is the collection of PCs, which are Principal components. PC1 represents the axis that covers the most variation in the data. PC2 represents the axis that covers the variation less than that of in PC1. Likewise, PC3 represents the axis that covers the variation less than that of in PC2, and so on. Therefore, it's <em>true</em> that the variation present in the PCs decrease as we move from the 1st PC to the last one.

(3) Image pre-processing is the phenomenon (or you can say the set of operation) used to improve and enhance the image by targeting the distortions within the image. That distortions are calculated using the neighbouring pixels of the given pixel in an image. Hence, the correct answer is <em>Image pre-processing</em>.

(4) SVM stands for State Vector Machine. It is basically a classifier, which is used to classify different (given) classes with precision. In simple terms, you can say that it is an algorithm, which is partially based on the given labeled data to predict the inputs. In technical terms, we call it weakly supervised learning algorithm. Hence, the correct answer is: <em>Weakly supervised learning algorithm.</em>

(5) There are many algorithms out there to detect the matching regions within two images. SURF (Scale Invariant Feature Transform) and SIFT (Speeded up Robust Feature) are two algorithms that can be used for matching patterns in the given images. Hence, you can choose any one of the two: SURF and SIFT.

(6) Indeed. Higher the accuracy is, better the classifier will be. However, there is a problem of <em>overfitting</em> that occurs when the accuracy of the classifier is way too high. Nevertheless, mostly, the classifier is better when there is higher accuracy. Hence, the correct answer to your question is <em>true</em>.

(7) True. Gradient descent is the process used to tune the parameters of the given neural network in order to decrease the error and increase the accuracy of the classifier. It calculates and fine-tune the parameters from the output to input direction by taking the gradient of the error function (sometimes called the loss function), which is the technique called backpropagation. Hence the correct answer is true.

(8) True. As explained in the part (5), SIFT which is called  scale-invariant feature transform, is an algorithm used to detech the features or the matching regions within given images. Hence, it's true that scale-invariant feature transform can be used to detect and describe local features in images.

(9) True. Clustering is indeed a supervised classification. In clusterning, we use graphs, which contains different data points in the form of clusters, to visualize the data as well. Imagine we have 7 fruits, out of which we know 6 of them, and we have to predict the 7th one. Let's say, 3 are apples and 3 are oranges. The set of apples is one cluster, and the set of oranges is another cluster. Now if we predict the 7th one by using the clustering technique, under the hood, that technique/algorithm will first train the model using the 6 fruits, which are known and then predict the 7th fruit. This kind of technique is a supervised learning, and hence, we can say that clustering is a supervised classification.

(10) In machine learning, Decision Tree Classifier is used to predict the value of the given input based on various known input variables. In this classifier, we can use both numeric and categorical values to get the results. Hence, the correct answer is <em>Decision Tree Classifier.</em>

(11) <em>Softmax </em>is the function which is used to convert the K-dimensional vector into the same shaped vector. The values of the Softmax function lies between 0 and 1, and it is primarily used as an activation function in a classification problems in neural networks (or deep neural networks). Hence, the correct answer is Softmax.

6 0
3 years ago
Which of the following is an Important criterion for evaluating the effctiveness of a graphic organizer
Gennadij [26K]

Answer:

how colorful it is how well it conveys information

Explanation:

3 0
4 years ago
Read 2 more answers
As part of its commitment to sustainability, a company is looking for a way to track the source of purchased goods and how they
luda_lava [24]

The primary technology that would enable the company to achieve this goal is Blockchain technology

  • Blockchain is commonly defined as an enclosed, encrypted, distributed database that is distributee in a wide range of multiple computers or nodes that are part of a community or system.

  • It is an exciting technologies as it helps to limit the incidence of security breaches by even its own users.

  • With Blockchain, a company can be able to guard against thefts of their products and also monitor them.

From the above we can therefore say that the answer to The primary technology that would enable the company to achieve this goal is Blockchain technology is correct

Learn more from:

brainly.com/question/24875333

6 0
3 years ago
Read 2 more answers
PLEASE I NEED HELP PLEASE PLEASE<br> Which function prompts the user to enter information?
Stels [109]

In python the input() function prompts the user to enter information.

5 0
3 years ago
Other questions:
  • Where is the cell membrane located in cell that do not have cell wall
    7·2 answers
  • NASA’s long term goal is for travel in space to be as _________________ as travel across the Atlantic. However, we are _________
    10·2 answers
  • In an ipv4 address, what are the maximum number of bits that can be used to identify the network address
    14·1 answer
  • What is the simple way to permanently get rid of an unwanted file
    14·1 answer
  • How long Will it take me to master scada and plc programming?​
    9·1 answer
  • After which stage in the information processing cycle can data be referred for future use?
    7·1 answer
  • Write a function named word_count that accepts a string as its parameter and returns the number of words in the string. A word i
    10·1 answer
  • Modify your previous exercise to determine if the user can ride a rollercoaster. To ride the rollercoaster, you must be at least
    12·1 answer
  • What 3 types of data can be entered in a spreadsheet
    14·1 answer
  • What function would you use to calculate the total interest paid for the first year of a mortgage?.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!