subject

The following truth table matches which boolean condition?

A B ?
1 1 1
1 0 1
0 1 0
0 0 1
A && ( A || B)

A || ( !A && !B)

A && ( A && B)

!A && ( A || !B)

A || ( A || B)

Consider the following class:

public class Thingy implements Comparable {
private int val;

public Thingy() {
this(0);
}

public Thingy(int t) {
val = t;
}
}

Which of the following methods must be included so this class can be instantiated?

compareTo

equals

indexOf

size

toString

Assume that x and y are boolean variables and have been properly initialized.

(x || y) && !(x && y)

The result of evaluating the expression above is best described as

Always true

Always false

True only when x is true and y is true

True only when x and y have the same value

True only when x and y have different values

You have created the following set of classes: Bus, Car, Scooter, Train, and Vehicle. Which would you choose to be the abstract class?

Bus

Car

Scooter

Train

Vehicle

Consider the method definition:

public static String analyzeTemps(int temps [], int avg) {
int above = 0;
int below = 0;
for(int i =0; i < temps. length; i++) {
if (temps[i] > avg)
above++;
if (temps[i] < avg)
below++;
}
if (above > below)
return "Hotter than normal";
if (above < below)
return "Cooler than normal";
return "Temperatures normal";
}

What is returned by the following?

int temps [] = {82 , 73 , 77 , 79 , 86 , 88 , 76 , 78 , 83};
System. out. println(analyzeTemps(temps, 81));

4

5

Cooler than normal

Hotter than normal

Temperatures normal

Consider the following code:

int list [] = /* missing code */;
int val = /* missing code */;
int n = -1;
for (int i = 0; i < list. length; i++) {
if (val == list[i]) {
n = i;
break;
}
}

What algorithm is shown?

Binary Search

Insertion Sort

Merge Sort

Selection Sort

Sequential Search

Suppose a child class has overridden a method of its parent class. What key word does the child class use to access the method in the parent class?

child

parent

static

super

this

What two methods from Object are often overridden?

add, compareTo

add, remove

toString, add

toString, equals

toString, compareTo

Consider the following class:

public class FrozenDesert{
public FrozenDesert() {
System. out. println("Yum");
}
}

You write a class, FrozenYogurt, which extends FrozenDesert. Which of the following is a correct implementation of the constructor for FrozenYogurt?

I.

public FrozenYogurt() {
System. out. println("I'm the new ice cream");
super();
}

II.

public FrozenYogurt() {
super();
System. out. println("I'm the new ice cream");
super();
}

III.

public FrozenYogurt() {
super();
System. out. println("I'm the new ice cream");
}

I only

II only

III only

I and II

I, II and III

The constant in the Integer wrapper class that represents the smallest int value is .

MIN

MIN_VALUE

SMALL_INT

SIZE

Integer. MAX

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 10:00, danthehero56
Which of the following is true of operations within a spreadsheet program’s built-in functions? a. operations within parentheses, then multiplication and division, and then addition and subtraction are computed. b. operations within parentheses, then addition and subtraction, and then multiplication and division are computed. c. multiplication and division, then addition and subtraction, and then operations within parentheses are computed. d. addition and subtraction, then multiplication and division, and then operations within parentheses are computed
Answers: 2
image
Computers and Technology, 22.06.2019 23:30, bri2008
Which of the following is not a symptom of chronic fatigue syndrome
Answers: 2
image
Computers and Technology, 23.06.2019 01:20, shiann2002
Me with this program in c++ ! computers represent color by combining sub-colors red, green, and blue (rgb). each sub-color's value can range from 0 to 255. thus (255, 0, 0) is bright red. (130, 0, 130) is a medium purple. (0, 0, 0) is black, (255, 255, 255) is white, and (40, 40, 40) is a dark gray. (130, 50, 130) is a faded purple, due to the (50, 50, 50) gray part. (in other word, equal amounts of red, green, blue yield gray).given values for red, green, and blue, remove the gray part. ex: if the input is 130 50 130, the output is: 80 0 80. thus, find the smallest value, and then subtract it from all three values, thus removing the gray.
Answers: 3
image
Computers and Technology, 23.06.2019 04:31, mona92
Which of the following is not a way in which trees benefit the environment? a. they remove a significant amount of carbon dioxide from the atmosphere. b. they remove a significant amount of oxygen from the atmosphere. c. their roots hold soil in place, reducing rates of erosion. d. they remove ozone and particulates from the atmosphere. select the best answer from the choices provided a b c d
Answers: 1
You know the right answer?
The following truth table matches which boolean condition?

A B ?
1 1 1
1...

Questions in other subjects:

Konu
Mathematics, 12.12.2020 17:10
Konu
Social Studies, 12.12.2020 17:10