answer.
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
Vinil7 [7]
2 years ago
11

#Create a class called Name. Name should have two attributes

Computers and Technology
1 answer:
prisoha [69]2 years ago
3 0

Answer:

//class Name

class Name {

// attributes gave you 3

String first_name;

String last_name;

int length = 0;

//constructor with 2 parameters

Name(String first_name, String last_name){

}

//methods

public String find_printed_name(){

return first_name + " " + last_name;

}

public void find_sortable_name(){

return last_name + ", " first_name.charAt(0);

}

public static void main(String[] args){

// instantiate the class

Name test_name = new Name("David", "Joyner");

System.out.println(test_name.first_name);

System.out.println(test_name.last_name);

System.out.println(test_name.find_printed_name());

System.out.println(test_name.find_sortable_name());

}

Explanation:

You didn't specify a language so I did it in Java.

You should know how to declare methods in Python.

You might be interested in
Consider the following two code segments, which are both intended to determine the longest of the three strings "pea", "pear", a
Nikolay [14]

Answer:

e) Code segment II produces correct output for all values of str, but code segment I produces correct output only for values of str that contain "pea" but not "pear".

Explanation:

<em>if - elseif - else statements work in sequence in which they are written. </em>

  • <em> </em>In case <em>if() statement is true, </em>else if() and else statements will not get executed.
  • In case <em>else if() statement is true</em>, conditions in if() and else if() will be checked and else statement will not be executed.
  • In case <em>if() and else if() both are false</em>, else statement will be executed<em>.</em>

First, let us consider code segment I.

In this, first of all "pea" is checked in if() statement which will look for "pea" only in the String str. So, even if "pearl" or "pear" or "pea" is present in 'str' the result will be true and "pea" will get printed always.

After that there are else if() and else statements which will not get executed because if() statement was already true. As a result else if() and else statements will be skipped.

Now, let us consider code segment II.

In this, "pearl" is checked in if() condition, so it will result in desired output.

Executable code is attached hereby.

Correct option is (e).

Download java
<span class="sg-text sg-text--link sg-text--bold sg-text--link-disabled sg-text--blue-dark"> java </span>
<span class="sg-text sg-text--link sg-text--bold sg-text--link-disabled sg-text--blue-dark"> java </span>
3 0
2 years ago
A domain's ____ settings must be configured correctly so that the mail transfer agent (mta) can establish a connection with a re
Oksi-84 [34.3K]

i think its firewall. Because the firewall can block protocols are are not allowed by an administrator. especially over a remote connection

5 0
2 years ago
Java Programming home &gt; 1.14: zylab training: Interleaved input/output Н zyBooks catalog Try submitting it for grading (click
Andru [333]

Answer:

The following are the code to this question:

code:

System.out.println(x);  //use print method to print value.

Explanation:

In the given question, it simplifies or deletes code in the 11th line. This line has a large major statement.  

In the case, the tests fail because only 1 line of output is required by the tester, but two lines are obtained instead.

It's to demonstrate that the input/output or testing requirements function throughout the model.

5 0
2 years ago
Which formula would you enter into C3, and then AutoFill into C4 through C6, to calculate the percent sales (Pct.) for the regio
inna [77]

Answer:

In C3, you would enter the formula:

  • =B3/$B$7%

Explanation:

Let's assume the first row is 1 and it contains the titles of the columns.  For instance, the content of the cellss A1:C1 could be:

  • A1: Region
  • B1: Sales
  • C1: Percent Sales

Also, assume the second row is empty and the cells on the first column, A, contain the names of four regions. For instance, North, South, East, and West:

  • A3: North
  • A4: South
  • A5: East
  • A6: West

The cells B3:B6 contain the sales for the four regions. For instance:

  • B3: 200
  • B4: 300
  • B5: 100
  • B6: 400

Then, you must calculate the percent sales for every region, in the cells <em>C3:C6.</em>

That means, you must divide the sale of every region by the total of sales and multiply by 100.

To do that in the worksheet you do this:

<u>1. Sum the sales for the regions:</u>

  • In cell B7 introduce: =SUM(B3:B6)

<u>2. Calculate the percent sale for the first region:</u>

  • In cell C3 introduce: =B3/$B$7%

That means that the reference B3 is relative: when you copy that formula, the column (B) and the row (3) will change accordingly to the cell where you will copy it.

Thus, by using the Autofill into C4 through C6, the column wil remain unchanged (C) and the row will change to 4, 5, and 6, respectively.

The symbol $ used in $B$7 make the reference absolute. That means that they will not change. The symbol % makes that the result is multiplied by 100.

<u>3. When you use Autofull into C4 through C6, you obtain:</u>

  • C4: =B4/$B$7%
  • C5: =B5/$B$7%
  • C6: =B6/$B$7%
4 0
2 years ago
"In Windows, what two terms describe the active partition on an MBR drive, and the location where the Windows operating system i
Oxana [17]

Answer:

Boot partition and system partition

Explanation:

System partition is the primary partition that is used as the active boot partition,it saves boot files and all files that will be used.  System partition is also known as the system directory or root directory and is usually given the identifier "c"

Boot partition is the disk partition that holds the files for the operating system files Windows operating system (either XP, Vista, 7, 8, 8.1 or 10), it works with the system partition and tells the computer where to look when starting. It given the identifier of letter "D" or "E"

5 0
2 years ago
Read 2 more answers
Other questions:
  • To read encrypted data, the recipient must decipher it into a readable form. what is the term for this process? re-securing decr
    5·1 answer
  • A mouse is known as a _____ device that is able to detect motion in relation to the surface and provides an onscreen pointer rep
    6·1 answer
  • In response to a recent outbreak of computer viruses, Babbage Industries, a large technology company, installs computer virus pr
    7·2 answers
  • Object-oriented development could potentially reduce the time and cost of writing software because: Group of answer choices a) i
    5·1 answer
  • 1.2.2: Output variable value. Jump to level 1 Write a statement that outputs variable userAge. End with a newline. 1 2 3 4 5 6 7
    12·1 answer
  • A website updated daily could be considered _____. a. authoritative b. objective c. accurate d. timely
    8·1 answer
  • A network router connects multiple computers together and allows them to send messages to each other. If two or more computers s
    7·1 answer
  • (choose one) Which is the proper means to decrement the integer variable, myScore, by one?
    15·1 answer
  • A Security team is working with a client to evaluate the security of data and IT functions that are most critical to the operati
    13·1 answer
  • You are responsible for a rail convoy of goods consisting of several boxcars. You start the train and after a few minutes you re
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!