• ¿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 4 fuera de 35 páginas
Examen

CSE 110 Study Guide Questions With Answers and Explanations

Document preview thumbnail
Vista previa 4 fuera de 35 páginas

CSE 110 Study Guide Questions With Answers and Explanations

Vista previa del contenido

CSE 110 STUDY GUIDE QUESTIONS
WITH ANSWERS AND EXPLANATIONS

1. What numeric value is assigned to result?
double result = Math.abs(-8);

A. 8

B. 9

C. -8

D. 0

Correct Answer: A. 8

Explanation: Math.abs returns the magnitude of its argument, so a negative value becomes positive.


2. A parking application uses the Java fragment below while working with primitive parameter passing.
What value is printed, and why?
static void change(int value) {
value = value + 10;
}

int n = 11;
change(n);
System.out.println(n);

A. 10, because the argument is replaced by the parameter.

B. 21, because parameters are aliases for all primitive variables.

C. 0, because void methods reset their arguments.

D. 11, because changing the primitive parameter does not change the caller's variable.

Correct Answer: D. 11, because changing the primitive parameter does not change the caller's variable.

Explanation: Java passes primitive argument values by value. The parameter receives a copy, so assigning to the
parameter does not alter the original variable.

3. A shipping calculator needs to store the whether a door is locked. Which type is the most appropriate?
A. String

B. int

C. double

D. boolean

Correct Answer: D. boolean

Explanation: boolean matches the kind of value described. The other choices represent different categories of data or an
unnecessarily restrictive representation.

,4. In a reservation system, the following fragment is used to apply two-dimensional arrays. What value is
stored in count after the nested traversal?
int count = 0;
int[][] grid = new int[4][5];
for (int r = 0; r < grid.length; r++)
for (int c = 0; c < grid[r].length; c++)
count++;

A. 21

B. 9

C. 20

D. 19

Correct Answer: C. 20

Explanation: The inner loop visits every column in each row, so the total number of visits equals rows multiplied by
columns.


5. For scenario Study Guide-89, what does this.width refer to inside the constructor?
class Box {
private int width;
Box(int width) {
this.width = width;
}
}

A. The width field of the current Box object.

B. A static field in the Math class.

C. The width of every object in every class.

D. The local parameter only.

Correct Answer: A. The width field of the current Box object.

Explanation: this refers to the current object. Qualifying the field as this.width distinguishes it from the parameter named
width.

,6. What value is stored in pos after this linear search?
int[] data = {31, 51, 54, 50, 46, 35, 30};
int target = 99;
int pos = -1;
for (int i = 0; i < data.length; i++) {
if (data[i] == target) { pos = i; break; }
}

A. -1

B. 99

C. 7

D. 0

Correct Answer: A. -1

Explanation: The loop scans indexes from left to right and stops at the first match. If no match is found, pos remains at its
sentinel value of -1.

7. For scenario Study Guide-93, which member normally represents behavior that an object can perform?
A. A filename extension

B. An import statement

C. An instance method

D. A primitive literal only

Correct Answer: C. An instance method

Explanation: Methods define behavior. Instance methods operate in the context of a particular object.


8. What is the Boolean value of the expression !(9 >= 7)?
A. 0

B. false

C. 1

D. true

Correct Answer: B. false

Explanation: Relational expressions are evaluated first, then the logical operators combine or negate the resulting Boolean
values according to Java rules.

, 9. What inclusive range can value take?
int value = rng.nextInt(7) + 8;

A. 8 through 14

B. 0 through 6

C. 9 through 15

D. 8 through 15

Correct Answer: A. 8 through 14

Explanation: nextInt(n) produces 0 through n-1. Adding the offset shifts both endpoints upward by that amount.

10. For scenario Study Guide-46, which approach is most appropriate when the number of user inputs is
not known in advance but processing stops on a special value?
A. A constant declaration only

B. A fixed-size arithmetic expression

C. A sentinel-controlled while loop

D. A switch with no loop

Correct Answer: C. A sentinel-controlled while loop

Explanation: A sentinel-controlled loop is designed for input sequences whose length is not known before execution.


11. What is displayed for the current value of x?
int x = 2;
if (x >= 24) {
System.out.println("high");
} else if (x >= 5) {
System.out.println("middle");
} else {
System.out.println("low");
}

A. nothing

B. low

C. high

D. middle

Correct Answer: B. low

Explanation: An if/else-if chain selects the first condition that evaluates to true and skips the remaining alternatives.

Información del documento

Subido en
26 de octubre de 2026
Número de páginas
35
Escrito en
2026/2027
Tipo
Examen
Contiene
Preguntas y respuestas
$15.99

¿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.
Favorgrades
3.8
(200)
Vendido
859
Seguidores
377
Artículos
58812
Última venta
21 horas 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