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
blsea [12.9K]
2 years ago
13

Which line of code will create an instance of the pet class?

Computers and Technology
2 answers:
Sunny_sXe [5.5K]2 years ago
8 0

Answer:

myPetA = pet(self, 'dog', 'Spot')

Explanation:

I mite be wrong

saul85 [17]2 years ago
8 0

Answer:

myPetA=pet('dog','Spot') or C

Explanation:

credit to who deserves it, the guy in the other answers comment section confimed my thought

You might be interested in
Do You assign the Needs Met rating before assigning the page quality (PQ) rating?
tensa zangetsu [6.8K]
IS GOD REAL.......................?<span>

</span>
6 0
3 years ago
A user found that their personal data had been exfiltrated from their computer by a malicious program that they clicked on sever
Firlakuza [10]

Answer:

Assuming this can only have one answer, i believe adware is very far from the type of malware that did infect the system, Spyware.

Explanation:

8 0
3 years ago
The ArrayList class contains a trim method that resizes the internal array to exactly the capacity. The trim method is intended
andreev551 [17]

Answer:

public void trimToSize() {

modCount++;

if (size < elementData.length) {

elementData = (size == 0)

? EMPTY_ELEMENTDATA

: Arrays.copyOf(elementData, size);

}

}

Now, the running time for copyOf() function is O(N) where N is the size/capacity of the ArrayList. Hence, the time complexity of trimToSize() function is O(N).

Hence, the running time of building an N-item ArrayList is O(N^2).

Please find the sample code below.

CODE

==================

import java.util.ArrayList;

public class Driver {

  public static void main(String[] args) throws Exception{

      int N = 100000;

      ArrayList<Integer> arr = new ArrayList<>(N);

     

      long startTime = System.currentTimeMillis();

      for(int i=0; i<N; i++) {

          arr.add(i);

          arr.trimToSize();

      }

      long endTime = System.currentTimeMillis();

      double time = (endTime - startTime)/1000;

      System.out.println("Total time taken = " + time + " seconds.");

  }

}

Explanation:

5 0
3 years ago
Does a triangle with sides of lengths 1.5 ft, 2.5 ft, and 2 ft form a right triangle? How do you know?
timama [110]

Answer:

Yes, the side lengths of 1.5, 2.5, and 2 ft form a right triangle.

Explanation:

Before we solve this problem, we need to know a couple of things.

In a right triangle, you have two legs and a diagonal line that goes from one leg to the other or from one side to the other. This line is called the hypotenuse. It is the longest side of a right triangle. This length can be calculated by using a special formula that is over a thousand years old.

The formula is called the Pythagorean Theorem.

The formula states that if you square one leg and the other leg and add it up. You get the side of hypotenuse which is squared as well.

Here it is in simple terms: a^{2} +b^{2} =c^{2}.

a and b are your two legs.

C is your hypotenuse.

In this case 1.5 and 2 are your legs and 2.5 is your hypotenuse since it is the longest side.

Before we calculate, there is a converse to the Pythagorean Theorem.

If a^{2} +b^{2} \neq c^{2}, then it is not a right triangle.

Lets make 1.5 for a

and 2 for b.

We know 2.5 is for c.

Here it is.

1.5^{2} +2^{2} =2.5^{2}. The / means it is a fraction.

1.5 squared is 9/4 and 2 squared is 4. Add 4 and 9/4 and you get 25/4 squared. Take the square root of 25/4 and you get 5/2.

5/2 is equal to 2.5, so the Pythagorean Theorem applies to this triangle. Therefore, these side lengths do form a right triangle.

Hope this helps!

3 0
3 years ago
Que se trata el RUC<br>​
mariarad [96]
No se senor i no sure
7 0
3 years ago
Other questions:
  • Which of these is outside the scope of an art director's responsibility?
    12·2 answers
  • Electronic files created on a computer using programs such as word software are considered to be
    15·1 answer
  • The version of Windows that first provided networking capabilities was _____.
    12·2 answers
  • g Define memory hierarchy. A. The rate at which information can be transferred from one place to another. B. Ordering storage sy
    8·1 answer
  • What is the web of trust
    7·2 answers
  • Fill in the blanks to make the factorial function return the factorial of n. Then, print the first 10 factorials (from 0 to 9) w
    6·1 answer
  • Which option is created specifically for giving a slide presentation in front of an audience and works when the speaker is utili
    14·1 answer
  • Q2
    7·2 answers
  • When trying to upload assignment on canvas wont let me click choose file.
    6·1 answer
  • Sharon's company has written a new computer program, and she has been asked to find a way to prevent people from copying the sof
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!