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]
3 years ago
13

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

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

Answer:

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

Explanation:

I mite be wrong

saul85 [17]3 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
True false) keybord has two shift keys.​
deff fn [24]

Answer:

True, looking at 'em right now!

Explanation:

8 0
4 years ago
A perfect binary tree is a complete binary tree with all levels fully filled. Add a method in the BST class to return true if th
algol [13]

Answer:

class BST {

static class Node

{

int val;

Node left, right;

}

static boolean checkPerfectBT(Node node, int h, int d)

{

if (node == null)

return true;

 

if (node.left == null && node.right == null)

{

if(h==d+1)

return true;

else

return false;

}

 

if (node.left == null || node.right== null)

return false;

 

return checkPerfectBT(node.left, h, d+1) && checkPerfectBT(node.right, h, d+1);

}

static int height(Node node)

{

int dep = 0;

while (node != null)

{

node = node.right;

dep=dep+1;

}

return dep;

}

static boolean isPerfectBT(Node node)

{

int h = height(node);

return checkPerfectBT(node, h, 0);

}

 

static Node addNode(int x)

{

Node node = new Node();

node.val= x;

node.right = null;

node.left = null;

return node;

}

public static void main(String args[])

{

int i,j,k;

Node node= null;

node = addNode(34);

node.left = addNode(2);

node.right = addNode(322);

 

node.left.left = addNode(21);

node.left.right = addNode(23);

node.right.left = addNode(37);

node.right.right = addNode(54);

 

if (isPerfectBT(node) == true)

System.out.println("This is a Perfect Binary tree");

else

System.out.println("This is Not a perfect Binary Tree");

}

}

Explanation:

  • Calculate the depth of BST by using a while loop until it reaches a null value.
  • In the addNode method, make an object of Node class.
  • In the main method, pass the values to addNode method.
  • Finally display the relevant message to show if it's Perfect or not.
6 0
4 years ago
What is green computing in non-technical term?​
DochEvi [55]

Answer:

Green computing is also known as green information technology (green IT)

4 0
3 years ago
What is the sentinel value in the following code snippet?
Airida [17]
The answer to the problem is 5
7 0
3 years ago
What is a Boolean operator
Alenkasestr [34]
A boolean operator is one of those: and, or, not
true and true gives you true
<span>false and false gives you false
</span><span>false and true gives you false
</span><span>true and false gives you false
</span>true or true gives you true
true or false gives you true
false or true gives you true
false or false gives you false
not true gives you false
not false gives you true
7 0
4 years ago
Read 2 more answers
Other questions:
  • 1. Which of the following are considered CAD powerhouses?
    6·1 answer
  • Define application pakage​
    5·2 answers
  • Write a function called list_codons which takes a single argument called orf (expected to be a string representing an ORF sequen
    7·1 answer
  • 2(x-5)-3(3-x)=1/2(x-2)
    9·1 answer
  • A key tactic that is used in many attacks, but very frequently in CEO Fraud, is creating a sense of what?
    15·2 answers
  • Two technicians are discussing engine valve timing. Technician A says that the optimum valve timing is found through experimenta
    13·2 answers
  • What is the value of 25 x 103 = ________?
    8·2 answers
  • How do you enter the decimal 73 into the computer?
    11·1 answer
  • What are the specifications of mine shaft head gear​
    11·2 answers
  • What type of dns servers field dns queries, send iterative queries to upstream dns servers, or send requests to forwarders and t
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!