100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.6 TrustPilot
logo-home
Exam (elaborations)

CSE 110 EXAM 2 2026 TEST PAPER SOLVED ITEMS ACCURATE MARKING

Rating
-
Sold
-
Pages
158
Grade
A+
Uploaded on
10-01-2026
Written in
2025/2026

CSE 110 EXAM 2 2026 TEST PAPER SOLVED ITEMS ACCURATE MARKING

Institution
CSE 110
Module
CSE 110











Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
CSE 110
Module
CSE 110

Document information

Uploaded on
January 10, 2026
Number of pages
158
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

CSE 110 EXAM 2 2026 TEST PAPER SOLVED
ITEMS ACCURATE MARKING

◉ What are the values of i and j after the following code fragment
runs?


int i = 60;
int j = 50;
int count = 0;
while (count < 5)
{
i = i + i;
i = i + 1;
j = j - 1;
j = j - j;
count++;
}
System.out.println("i=" + i + ", j=" + j);


a) i = 1951, j = 0
b) i = 1951, j = 45

,c) i = 65, j = 1
d) i = 65, j = 45. Answer: Answer: a) i = 1951, j = 0


◉ 9) Which error type does the "off-by-one" error belong to?


a) Syntax error
b) Compile-time error
c) Run-time error
d) Infinite loop. Answer: Answer: c) Run-time error


◉ 10) How many times does the following code fragment display
"Hi"?


int i = 10;
while (i >= 0)
{
System.out.println("Hi");
i--;
}


a) 9 times
b) 10 times

,c) 11 times
d) 12 times. Answer: Answer: c) 11 times


◉ 11) What is the output of the following code fragment?


int i = 1;
int sum = 0;
while (i <= 11)
{
sum = sum + i;
i++;
}
System.out.println("The value of sum is " + sum);


a) The value of sum is 65
b) The value of sum is 66
c) The value of sum is 55
d) The value of sum is 56. Answer: Answer: b) The value of sum is 66


◉ 12) How many times does the loop execute in the following code
fragment?

, int i;
for (i = 0; i < 50; i = i + 4)
{
System.out.println(i);
}


a) 11
b) 12
c) 13
d) 14. Answer: Answer: c) 13


◉ 13) How many times does the following code snippet display
"Loop Execution"?


for (int i = 0; i < 10; i++);
{
System.out.println("Loop Execution");
}


a) Ten times.
b) The code snippet does not run because of a compile error.
c) Infinite loop.

Get to know the seller

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.
FocusFile7 Harvard University
Follow You need to be logged in order to follow users or courses
Sold
44
Member since
7 months
Number of followers
2
Documents
21568
Last sold
2 days ago
FocusFile7

Welcome to FocusFile, your inspiring hub for academic excellence! Just like your favorite café where every sip brings comfort, FocusFile is designed to be your go-to space for clear thinking, deep focus, and study success. Here at FocusFile, I believe learning isn’t just about cramming it’s about clarity, growth, and building the confidence to conquer any challenge. That’s why you’ll find a handpicked collection of top-notch, easy-to-digest study materials, smart summaries, and guides tailored to a wide range of subjects and learning styles. Whether you're gearing up for exams, brushing up on class notes, or just need that extra push, FocusFile has you covered. From quick-reference sheets to deep-dive notes, there’s something here for every learner whether you're a visual thinker, a bullet-point lover, or someone who thrives on quick, impactful insights. Think of FocusFile as your academic sanctuary, a place where productivity meets peace of mind. So grab your favorite drink, settle in, and let’s sharpen your focus and fuel your success, one file at a time. Thanks for making FocusFile your study partner. Let’s unlock your full potential together!

Read more Read less
4.3

4 reviews

5
2
4
1
3
1
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

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

Didn't get what you expected? Choose another document

No problem! You can straightaway pick a different document that better suits what you're after.

Pay as you like, start learning straight 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 smashed it. It really can be that simple.”

Alisha Student

Frequently asked questions