• ¿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 Unit Test 1 - Questions with Correct Answers (Verified Update)

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

CMSC 131 Object Oriented Programming I Unit Test 1 (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 n = 5; int m = n++ + ++n; What is the value of m + ":" + n? | An analyst needs to distinguish integer division and reference type. Which observations illustrate them in that order? | A menu uses a number's remainder modulo two to test evenness. Which course concept gives the most specific explanation? | Which statement changes an already declared int score to 12?

Vista previa del contenido

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

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


2. An analyst needs to distinguish integer division and reference type. Which observations illustrate
them in that order?
A. Seven int units distributed in groups of three yields only two whole groups. / A String variable
can refer to a particular text object.
B. A String variable can refer to a particular text object. / Seven int units distributed in groups of
three yields only two whole groups.
C. A declared final limit is used instead of repeating a raw number. / A String variable can refer to a
particular text object.
D. Seven int units distributed in groups of three yields only two whole groups. / A menu uses a
number's remainder modulo two to test evenness.
Answer: A. Seven int units distributed in groups of three yields only two whole groups. / A String
variable can refer to a particular text object.
Rationale: Dividing two int values truncates the quotient toward zero if the divisor is nonzero. A
reference type represents references to objects or the null reference.

,3. Which pair of examples illustrates primitive type followed by assignment?
A. A second statement replaces the number stored in score. / A variable declaration uses int for
the number of seats.
B. A variable declaration uses int for the number of seats. / A menu uses a number's remainder
modulo two to test evenness.
C. A variable declaration uses int for the number of seats. / A second statement replaces the
number stored in score.
D. Seven int units distributed in groups of three yields only two whole groups. / A second
statement replaces the number stored in score.
Answer: C. A variable declaration uses int for the number of seats. / A second statement replaces the
number stored in score.
Rationale: A primitive type directly represents a fixed category of values such as int, double or
boolean. Assignment evaluates a value and stores it in the designated variable or location.


4. A menu uses a number's remainder modulo two to test evenness. Which course concept gives the
most specific explanation?
A. Precedence
B. Remainder operator
C. Identifier
D. Symbolic constant
Answer: B. Remainder operator
Rationale: The remainder operator reports the leftover from truncated division for integral
operands.


5. Which statement changes an already declared int score to 12?
A. score = 12;
B. Assign an int expression to a double variable
C. Integer division
D. boolean ready = true;
Answer: A. score = 12;
Rationale: Assignment evaluates a value and stores it in the designated variable or location.

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