subject

The following truth table matches which boolean condition? AB?
111
101
010
001
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?
a. compareTo
b. equals
c. indexOf
d. size
e. 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:.
A. Always true
B. Always false
C. True only when x is true and y is true
D. True only when x and y have the same value
E. 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?
A. Bus
B. Car
C. Scooter
D. Train
E. 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?
A. Binary Search
B. Insertion Sort
C. Merge Sort
D. Selection Sort
E. 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?
a. child
b. parent
c. static
d. super
e. this
What two methods from Object are often overridden?
a. add, compareTo
b. add, remove
c. toString, add
d. toString, equals
e. 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");
}
a. I only
b. II only
c. III only
d. I and II
e. I, II and III
The constant in the Integer wrapper class that represents the smallest int value is .
A. MIN
B. MIN_VALUE
C. SMALL_INT
D. SIZE
E. Integer. MAX

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 13:00
Why the bear has a slunky tail determine the meaning of the word slunk in the story
Answers: 1
question
Computers and Technology, 22.06.2019 23:30
Jaina and tomas are being considered as new tenants in an apartment. the landlord looks at their creditworthiness because he wants to be sure his new tenant pays the rent on time and in full. the table below summarizes the information that was on their applications. application information questions jaina tomas how many years have you had your job? 5 2 what is your monthly salary? $1,850 $2,500 how many credit cards do you have? 4 1 how much debt do you have? $13,000 $7,000 how many times were you late with payments on credit cards in the past year? 5 1 who will the landlord decide to be more creditworthy and why? tomas because the ratio of his debt to income is less. jaina because she has had her job longer, which makes her look more stable. jaina because she has more credit cards available to her. tomas because he makes more money per month.
Answers: 2
question
Computers and Technology, 23.06.2019 00:00
Suppose you have 9 coins and one of them is heavier than others. other 8 coins weight equally. you are also given a balance. develop and algorithm to determine the heavy coin using only two measurements with the of the balance. clearly write your algorithm in the form of a pseudocode using the similar notation that we have used in the class to represent sorting algorithms
Answers: 1
question
Computers and Technology, 23.06.2019 15:10
What role did women fill during world war ii?
Answers: 1
You know the right answer?
The following truth table matches which boolean condition? AB?
111
101
010
...
Questions
question
Social Studies, 18.09.2020 14:01
question
Mathematics, 18.09.2020 14:01
question
Mathematics, 18.09.2020 14:01
question
Social Studies, 18.09.2020 14:01
question
Mathematics, 18.09.2020 14:01
question
Mathematics, 18.09.2020 14:01
question
Arts, 18.09.2020 14:01
question
Mathematics, 18.09.2020 14:01
question
Mathematics, 18.09.2020 14:01
question
Mathematics, 18.09.2020 14:01
question
English, 18.09.2020 14:01
question
Mathematics, 18.09.2020 14:01
question
English, 18.09.2020 14:01
question
Mathematics, 18.09.2020 14:01
question
Geography, 18.09.2020 14:01
question
Mathematics, 18.09.2020 14:01
question
Mathematics, 18.09.2020 14:01
question
Mathematics, 18.09.2020 14:01
question
Mathematics, 18.09.2020 14:01
question
Mathematics, 18.09.2020 14:01
Questions on the website: 13722362