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 4 out of 37 pages
Exam (elaborations)

OSU CSE 2221 EXAM STUDY GUIDE 2026 QUESTIONS AND ANSWERS 100% ACCURATE

Document preview thumbnail
Preview 4 out of 37 pages

OSU CSE 2221 EXAM STUDY GUIDE 2026 QUESTIONS AND ANSWERS 100% ACCURATE

Content preview

OSU CSE 2221 EXAM STUDY GUIDE 2026
QUESTIONS AND ANSWERS 100%
ACCURATE

⩥ d. Answer: What is the value of s after the following statement:


String s = (!true) + " : " + (10 + 4) + " is 104";


*a.* "!true : 104 is 104"
*b.* "false : 104 is 104"
*c.* "!true : 14 is 104"
*d.* "false : 14 is 104"
*e.* This is a compile-time error


⩥ b. Answer: The Checkstyle plugin for Eclipse is useful because:


*a.* it warns you of potential compile-time errors
*b.* it helps you make your code understandable for yourself and other
programmers
*c.* it prevents your code from making errors caught by assert
statements
*d.* it tells you when code you have written does not obey its contract

,*e.* none of the above


⩥ d. Answer: If x is an int variable, when does the boolean expression
evaluate to true?


((x % 5 != 0) && (x % 2 != 0))


*a.* when x is divisible by 5 or by 2 but not by both
*b.* when x is divisible by 10
*c.* when x is not divisible by 10
*d.* when x is neither divisible by 5 nor by 2
*e.* when x is either divisible by 5 or by 2


⩥ b. Answer: The nextDouble( ) method of r, a variable of type Random,
returns a double in a range of [0,1). Which of these expressions would
you use to create a random number in the range of [-3,3)?


*a.* r.nextDouble( ) * 3.0 - 3.0
*b.* (r.nextDouble( ) - 0.5) * 6.0
*c.* r.nextDouble( ) * 6.0 + 3.0
*d.* r.nextDouble( ) * 6.0 + 0.5
*e.* (r.nextDouble( ) - 3.0) * 6.0

,⩥ a. Answer: Consider the following code fragment:


int x = 8;
while ((x / 3) != 2) { x = x - 1; }


How many times will the body of the loop execute?


*a.* 0
*b.* 1
*c.* 2
*d.* 3
*e.* the loop will never terminate


⩥ c. Answer: Consider the following method signature:


private static int examScore(int studentNum) {...}


Here, studentNum is called:


*a.* distinguished variable
*b.* an argument
*c.* a formal parameter

, *d.* an index
*e.* none of the above


⩥ a. Answer: What is the value of x after this statement?


double x = ;


*a.* 0.0
*b.* 0.5
*c.* 1.0
*d.* 2.0


⩥ c. Answer: Consider the following method and the client code. What
is true after the client code executes?


private static int m(int x, int y) {
y = x;
x = 0;
return y;
}


int num1 = 4, num 2 = 9;

Document information

Uploaded on
January 21, 2026
Number of pages
37
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$12.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.
TopGradeInsider
4.1
(9)
Sold
130
Followers
2
Items
46214
Last sold
1 day 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