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

Intro to Java Programming Chapter 5- Questions and Answers| Latest Update

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

Intro to Java Programming Chapter 5- Questions and Answers| Latest Update

Vista previa del contenido

Intro to Java Programming Chapter 5- Questions
and Answers| Latest Update
Which of the following variables is used to store a condition that can be either true or false?


A. Logical
B. Conditional
C. Algebraic

D. Boolean ✔️✔️Boolean


Which of the following operators is used to combine two Boolean conditions?


A. $$
B. & &
C. %%

D. ## ✔️✔️& &


Which of the following expressions represents a legal way of checking whether a value for the
num variable is either less than 100 or more than 200?


A. if (num < 100 || num> 200)
B. if (num < 100 && num > 200)
C. if (num <= 100 && num >= 200)

D. if (num <= 100 || num >= 200) ✔️✔️if (num < 100 || num> 200)


Which of the following options checks that the string country is neither China nor Denmark?

, A. if (country.equals("China") || country.equals("Denmark"))
B. if (!(country.equals("China") || country.equals("Denmark")))
C. if (!country.equals("China") || !country.equals("Denmark")

D. if (!(country.equals("China") && country.equals("Denmark"))) ✔️✔️if
(!(country.equals("China") || country.equals("Denmark")))


Which of the following conditions tests for the user to enter the string "Hello"?


A. if (s = "Hello")
B. if (s.substring(0,5) == "Hello")
C. if (s == "Hello")

D. if (s.equals("Hello")) ✔️✔️if (s.equals("Hello"))


Which of the following conditions tests whether the user enters an integer value that will then
be assigned to the floor variable?


int floor = 0;
Scanner in = new Scanner(System.in);
System.out.print("Floor: ");
if (...)
{
floor = in.nextInt();
}


A. in.nextInt()
B. in.nextInt(floor)
C. in.fail

D. in.hasNextInt() ✔️✔️in.hasNextInt()

Información del documento

Subido en
21 de marzo de 2025
Número de páginas
10
Escrito en
2024/2025
Tipo
Examen
Contiene
Preguntas y respuestas
$8.49

¿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.
KateJones
4.8
(12)
Vendido
32
Seguidores
0
Artículos
5716
Última venta
4 semanas 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