• ¿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 11 páginas
Examen

D278 practice exam 1 Questions and Correct Answers

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

D278 practice exam 1 Questions and Correct Answers

Vista previa del contenido

D278 practice exam 1 Questions and Correct
Answers
A bus driver starts a route with 12 passengers. At the first stop, 4 passengers get on and 3

get off. What is the value of numPassengers after the first stop?

13

A program tracks the number of books returned to a library. The variable returnedBooks

should hold a count value. Which data type should the variable be?

Integer

A baker's recipe uses a fixed sugar-to-flour ratio of 0.4 in many calculations. How should

the item that holds this ratio be declared?

Constant float sugarFlourRatio

Given integer a = 6 and integer b = 4. What is the value of the expression (a / 2.0) + b?

7.0

Given float p = 8.4 and float q = 2.0. What is the value of the expression p / q?

4.2

What kind of operator is the != in the expression count != 10?

Relational (inequality)

A program is checking whether userScore is between 70 and 89 inclusive (a B grade range).

Which expression correctly captures this range?

, (userScore >= 70) and (userScore <= 89)

Which operator should be used to determine if a number is evenly divisible by 3?

%

Which data type is used to track a person's exact weight in pounds?

Float

A weather program needs to determine if it is currently raining (true or false). Which data

type should be used for that variable?

Boolean

Given integer x = 8 and integer y = 3. What is the value of the expression (x % y) + (x / y)?

4

A movie theater offers a senior discount with the following logic: if customerAge >= 65 then

ticketPrice = 8, else ticketPrice = 12. Given customerAge = 70, what is the final value of

ticketPrice?

8

A delivery service charges extra for heavy packages with the following logic: if

packageWeight > 50 then fee = 25, else fee = 10. If packageWeight is 45, which branch

executes?

else (false) branch

A program should prompt the user to enter test scores and continue accepting scores until

the user enters -1 to stop. Which control structure should be used?

Información del documento

Subido en
2 de julio de 2026
Número de páginas
11
Escrito en
2025/2026
Tipo
Examen
Contiene
Preguntas y respuestas
$13.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.
KenAli
2.6
(18)
Vendido
119
Seguidores
5
Artículos
25431
Última venta
13 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