• ¿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

CMSC 131 Object Oriented Programming I Calculations Test - Questions with Correct Answers (Verified Update)

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

CMSC 131 Object Oriented Programming I Calculations Test (University of Maryland): 17 exam questions with verified correct answers and rationales, for CMSC 131 at University of Maryland. 9 pages, 2026 verified update. Sample questions covered: int p = 14; What is the value of p / 3 * 2? | int n = -32; What is the value of n % 3? | int n = 6; int m = n++ + ++n; What is the value of m + ":" + n? | int n = 5; int score = 0; if (n = 5) score += 3; else if (n = 7) score += 7; What is the value of score?

Vista previa del contenido

CMSC 131 Object-Oriented Programming I: Calculations Test
Questions and Answers - University of Maryland

1. int p = 14; What is the value of p / 3 * 2?
A. 8
B. 9
C. 14
D. 4
Answer: A. 8
Rationale: Integer division yields 4 before the multiplication by two.


2. int n = -32; What is the value of n % 3?
A. -1
B. -2
C. 2
D. 1
Answer: B. -2
Rationale: For integer remainder the result has the dividend’s sign when it is nonzero.


3. int n = 6; int m = n++ + ++n; What is the value of m + ":" + n?
A. 14:8
B. 13:8
C. 14:7
D. 15:8
Answer: A. 14:8
Rationale: The left operand yields the old value and increments n. The right operand increments it
again before yielding.

,4. What is the decimal value of the binary Java literal 0b110100?
A. 52
B. 26
C. 56
D. 104
Answer: A. 52
Rationale: Sum the powers of two corresponding to positions with a one digit.


5. int n = 5; int score = 0; if (n <= 5) score += 3; else if (n <= 7) score += 7; What is the value of score?
A. 7
B. 0
C. 3
D. 10
Answer: C. 3
Rationale: The first condition is true, so the else-if body does not execute.


6. int n = 3; boolean ok = n < 3 && ++n > 0; What is the value of n?
A. 5
B. 4
C. 3
D. 2
Answer: C. 3
Rationale: The equality boundary makes the left comparison false. Conditional AND skips the
increment.

Información del documento

Subido en
20 de noviembre de 2026
Número de páginas
9
Escrito en
2026/2027
Tipo
Examen
Contiene
Preguntas y respuestas
$8.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.
DrJon
3.8
(161)
Vendido
620
Seguidores
188
Artículos
29629
Última venta
2 días 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