Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 3 out of 20 pages
Exam (elaborations)

CS 1114 Final Exam COMPLETE QUESTIONS WITH OUTLINED ANSWERS

Document preview thumbnail
Preview 3 out of 20 pages

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

Content preview

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

Document information

Uploaded on
January 15, 2026
Number of pages
20
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$13.99

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
IszackBd
5.0
(3)
Sold
40
Followers
3
Items
5715
Last sold
6 hours ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions