Escrito por estudiantes que aprobaron Inmediatamente disponible después del pago Leer en línea o como PDF ¿Documento equivocado? Cámbialo gratis 4,6 TrustPilot
logo-home
Document preview thumbnail
Vista previa 3 fuera de 20 páginas
Examen

CS 1114 Final Exam COMPLETE QUESTIONS WITH OUTLINED ANSWERS

Document preview thumbnail
Vista previa 3 fuera de 20 páginas

CS 1114 Final Exam COMPLETE QUESTIONS WITH OUTLINED ANSWERS A Jeroo method that requires you to specify a direction when you call it is: 1) hop() 2) plant() 3) turn() 4) pick() turn() A Jeroo can carry these: 1) Flowers 2) water 3) other jeroos 4) nets flowers() True or False - A subclass can represent a less specialized concept than its superclass False - a subclass can represent a more specialized concept than its superclass Which of the following is NOT a step to consider when design an algorithm? 1) consider the problem and ask additional questions 2) get a problem description 3) all of these are steps 4) create a high-level algorithm all of these are steps In what step of algorithm development do we ask what rules exist for working with the data? 1) when we review the algorithm we've created 2) when we get a problem description 3) when we refine out high-level algorithm 4) when we analyze the problem when we analyze the problem Where should pre and postconditions be stated? 1) at the top of a java file before a class is declared 2) in a comment block below the method 3) in a comment block just under the method definition 4) in a comment block above the method in a comment block above the method What is the method identifier in the following method definition public int add3Ints(int a, int b, int c) { return a + b + c; } 1) add3Ints 2) public 3) int 4) return 5) a + b + c add3Ints In an if-then-else structure, if the condition in the if statement is false, which of the following will happen 1) nothing 2) the code will proceed to the next line after the if-then-else structure 3) the code inside of the {} of the if statement will run 4) the code inside of the brackets in the else branch will run the code inside of the bracket in the else branch will run Assume we see an if statement that reads if (! true). What would you know about this code 1) the code inside this conditional would always run 2) this code would compile, but would fail if you tried to run it 3) if (!true) would produce a syntax error 4) the code inside this conditional would never run the code inside this conditional would never run Assume boolean variable a is true and boolean variable b is false. Would if (a && b) run the code in the if statement? 1) no - both variables need to be true for the if statement to run 2) yes - at least one boolean is true so the whole statement is true 3) yes - at least one boolean is false so the whole statement is true 4) no - this code would produce an error no - both variables need to be true for the if statement to run Assume boolean variable a is true and boolean variable b is false. Would if (a || b) run the code in the if statement? 1) no - both variables need to be true for the if statement to run 2) yes - at least one boolean is true so the whole statement is true 3) yes - at least one boolean is false so the whole statement is true 4) no - this code would produce an error yes - at least one boolean is true so the whole statement is true What is the difference between an if-then structure and a while loop a) an if-then structure can contain multiple conditionals b) a while loop does not need a conditional c) a while loop can repeatedly execute a block of code many times d) an if-then structure is more efficient but more complicated a while loop can repeatedly execute a block of code many times how many times will conor hop while (true) { (); } a) this loop will never run b) this loop will produce a syntax error c) this loop will run 17 times and then produce a syntax error d) this loop will never stop this loop will never stop Which of the following statements are NOT true about objects? a) creating a new object is called instantiation b) renaming an object is called reconstruction c) object-orientated programming uses objects to model parts of a program (like LightBots or a world) d) each object provides a set of behaviors that it understands. these are called methods renaming an object is called reconstruction

Vista previa del contenido

CS 1114 Final Exam COMPLETE QUESTIONS
WITH OUTLINED ANSWERS

A Jeroo method that requires you to specify a direction when you call it is:
1) hop()
2) plant()
3) turn()
4) pick()

turn()

A Jeroo can carry these:
1) Flowers
2) water
3) other jeroos
4) nets

flowers()

True or False - A subclass can represent a less specialized concept than its superclass

False - a subclass can represent a more specialized concept than its superclass

Which of the following is NOT a step to consider when design an algorithm?
1) consider the problem and ask additional questions
2) get a problem description
3) all of these are steps
4) create a high-level algorithm

all of these are steps

In what step of algorithm development do we ask what rules exist for working with the data?
1) when we review the algorithm we've created
2) when we get a problem description
3) when we refine out high-level algorithm
4) when we analyze the problem

when we analyze the problem

,Where should pre and postconditions be stated?
1) at the top of a java file before a class is declared
2) in a comment block below the method
3) in a comment block just under the method definition
4) in a comment block above the method

in a comment block above the method

What is the method identifier in the following method definition
public int add3Ints(int a, int b, int c)
{
return a + b + c;
}
1) add3Ints
2) public
3) int
4) return
5) a + b + c

add3Ints

In an if-then-else structure, if the condition in the if statement is false, which of the following
will happen
1) nothing
2) the code will proceed to the next line after the if-then-else structure
3) the code inside of the {} of the if statement will run
4) the code inside of the brackets in the else branch will run

the code inside of the bracket in the else branch will run

Assume we see an if statement that reads if (! true). What would you know about this code
1) the code inside this conditional would always run
2) this code would compile, but would fail if you tried to run it
3) if (!true) would produce a syntax error
4) the code inside this conditional would never run

the code inside this conditional would never run

Assume boolean variable a is true and boolean variable b is false. Would if (a && b) run the
code in the if statement?
1) no - both variables need to be true for the if statement to run
2) yes - at least one boolean is true so the whole statement is true

, 3) yes - at least one boolean is false so the whole statement is true
4) no - this code would produce an error

no - both variables need to be true for the if statement to run

Assume boolean variable a is true and boolean variable b is false. Would if (a || b) run the
code in the if statement?
1) no - both variables need to be true for the if statement to run
2) yes - at least one boolean is true so the whole statement is true
3) yes - at least one boolean is false so the whole statement is true
4) no - this code would produce an error

yes - at least one boolean is true so the whole statement is true

What is the difference between an if-then structure and a while loop
a) an if-then structure can contain multiple conditionals
b) a while loop does not need a conditional
c) a while loop can repeatedly execute a block of code many times
d) an if-then structure is more efficient but more complicated

a while loop can repeatedly execute a block of code many times

how many times will conor hop
while (true)
{
conor.hop();
}
a) this loop will never run
b) this loop will produce a syntax error
c) this loop will run 17 times and then produce a syntax error
d) this loop will never stop

this loop will never stop

Which of the following statements are NOT true about objects?
a) creating a new object is called instantiation
b) renaming an object is called reconstruction
c) object-orientated programming uses objects to model parts of a program (like LightBots or
a world)
d) each object provides a set of behaviors that it understands. these are called methods

renaming an object is called reconstruction

Información del documento

Subido en
15 de enero de 2026
Número de páginas
20
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.
IszackBd
5.0
(3)
Vendido
40
Seguidores
3
Artículos
5715
Última venta
7 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