• ¿Documento equivocado? Cámbialo gratis
  • Escrito por estudiantes que aprobaron
  • Inmediatamente disponible después del pago
  • Leer en línea o como PDF
Vender
¿Dónde estudias?
Tu idioma
Document preview thumbnail
Vista previa 2 fuera de 9 páginas
Examen

CS 170 || Already Passed.

Document preview thumbnail
Vista previa 2 fuera de 9 páginas

If an account balance is $1,000 or more, you pay interest. If the balance is less than $100 you charge a fee. The best way to write this is to : correct answers use two if statements If s is a String object, which of these relational expressions is illegal (that is, your code will not compile if you use it) : correct answers s "Hi" The second operand used by the conditional operator must have the type : correct answers Any type is OK When a selection statement causes a line of code to be executed, that line of code is called : correct answers a branch What is the output of the following Java code? int x = 0; if (x 0) println("One "); println("Two "); println("Three"); correct answers Two Three Which of the following is a relational operator? correct answers == Which of the following is not a selection control structure in Java? correct answers case Two-way selection in Java is implemented using ____. correct answers if...else statements In a ____ control structure, the computer executes particular statements depending on some condition(s). correct answers selection Which of the following is NOT a relational operator in Java? correct answers According to the online lessons, _________________ are the components used to build OOP computer programs. correct answers objects Normally, in an object, the methods are _____________, while the fields are ___________. correct answers public, private According to the online lessons, the ________ of an object includes all the information about the object; that is, its attributes or characteristics. correct answers state To create a new class by adding features or data elements to an existing class, you use the OOP technique of correct answers inheritance

Vista previa del contenido

CS 170 || Already Passed.
If an account balance is $1,000 or more, you pay interest. If the balance is less than $100 you
charge a fee. The best way to write this is to : correct answers use two if statements

If s is a String object, which of these relational expressions is illegal (that is, your code will not
compile if you use it) : correct answers s > "Hi"

The second operand used by the conditional operator must have the type : correct answers Any
type is OK

When a selection statement causes a line of code to be executed, that line of code is called :
correct answers a branch

What is the output of the following Java code?
int x = 0;
if (x < 0)
println("One ");
println("Two ");
println("Three"); correct answers Two
Three

Which of the following is a relational operator? correct answers ==

Which of the following is not a selection control structure in Java? correct answers case

Two-way selection in Java is implemented using ____. correct answers if...else statements

In a ____ control structure, the computer executes particular statements depending on some
condition(s). correct answers selection

Which of the following is NOT a relational operator in Java? correct answers <<

According to the online lessons, _________________ are the components used to build OOP
computer programs. correct answers objects

Normally, in an object, the methods are _____________, while the fields are ___________.
correct answers public, private

According to the online lessons, the ________ of an object includes all the information about the
object; that is, its attributes or characteristics. correct answers state

To create a new class by adding features or data elements to an existing class, you use the OOP
technique of correct answers inheritance

, The generic term for methods that carry out an action is a ____________________. correct
answers procedure

Methods like setBackground() that you can use in your own applets are called
____________________ methods. correct answers inherited

When your program first starts, instead of specifying the exact steps to carry out, you can specify
the steps to perform in a general way. Later, you can supply the definition for the general
commands that you've used. This is called: correct answers top-down design

Look at the following few lines of code:

public void printTopHalf()
{
// Statements go here
}

the word printTopHalf is the: correct answers method name

Look at the following few lines of code:

public void printTopHalf()
{
// Statements go here
}

the parentheses following printTopHalf is the: correct answers parameter list

Which modifier is used to specify that a method cannot be used outside a class? correct answers
private

public String exampleMethod(int n, char ch) correct answers String

public int minimum(int x, int y)
{
int smaller = Math.min(x, y);
return smaller;
}
Based on the above code, what would be the output of the statement

int s = minimum(5, minimum(3, 7)); correct answers 3

Which of the following is NOT true about return statements? correct answers return statements
can be used in void methods to return values.

Información del documento

Subido en
25 de marzo de 2025
Número de páginas
9
Escrito en
2024/2025
Tipo
Examen
Contiene
Preguntas y respuestas
$11.79

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
SirAnton
3.7
(118)
Vendido
811
Seguidores
438
Artículos
40316
Última venta
1 semana hace




Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes