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
Exam (elaborations)

COMPUTER PROGRAMMING EXAM 2 QUESTIONS AND CORRECT ANSWERS

Rating
-
Sold
-
Pages
2
Grade
A+
Uploaded on
21-11-2025
Written in
2025/2026

COMPUTER PROGRAMMING EXAM 2 QUESTIONS AND CORRECT ANSWERS

Institution
CSCE 102
Course
CSCE 102

Content preview

COMPUTER PROGRAMMING EXAM 2
QUESTIONS AND CORRECT
ANSWERS
WhatA2willA2theA2followingA2codeA2print?:A2intA2count;A2forA2(countA2=A210;A2countA2>A26;A2c
ount--)A2System.out.print(countA2+A2"A2");A2-A2Ans--10A29A28A27

WhatA2isA2theA2valueA2ofA2theA2expressionA2(xA2>A23)A2||
A2(yA2<A23)A2ifA2xA2hasA2theA2valueA21A2andA2yA2hasA2theA2valueA25?A2-A2Ans--
TheA2valueA2ofA2thisA2expressionA2isA2False

TheA2bodyA2ofA2anyA2whileA2loopA2willA2beA2executedA2atA2leastA2once.A2-A2Ans--
FalseA2(bodyA2willA2beA2executedA2atA2leastA2once)

EveryA2statementA2withA2ifA2mustA2alsoA2includeA2elseA2-A2Ans--
False,A2everyA2ifA2statementA2willA2notA2alsoA2includeA2"else".

WhatA2isA2outputA2byA2theA2followingA2code?A2
intA2pA2=A24;A2intA2mA2=A230,A2j;A2forA2(jA2=A21;A2jA2<A2p;A2j++);
A2{A2mA2=A2mA2+A2jA2*A2j;A2}A2System.out.println(m);A2-A2Ans--34


AnA2!A2inA2anA2expressionA2means:A2-A2Ans--Not

AA2do-whileA2loopA2willA2loopA2atA2leastA2once.A2-A2Ans--(false)A2doA2while

WhatA2willA2theA2followingA2codeA2print?
A2intA2colorA2=A21;A2switchA2(color)A2{A2caseA21:A2caseA22:A2System.out.print("redA2");A2case
A23:A2System.out.print("blueA2");A2caseA24:A2System.out.print("purple"); A2break;A2default:A2
System.out.print("gray");A2}A2-A2Ans--RedA2BlueA2Purple

WriteA22A2lineA2codeA2snippetA2usingA2aA2for-
loopA2thatA2willA2printA2theA2numbersA218,A26,A22A2-A2Ans--
for(intA2iA2=A218;A2iA2>=2;A2iA2=A2i/3)
System.out.println(i);

AA2multibranchA2if-elseA2statementA2isA2oneA2kindA2ofA2nestedA2if-elseA2statement.A2-
A2Ans--True,A2IsA2aA2nestedA2statement


A(n)A2__________A2goesA2inA2theA2parenthesesA2followingA2theA2wordA2ifA2inA2anA2if-
elseA2statement.A2-A2Ans--ParameterA2List

WhatA2isA2outputA2byA2theA2followingA2code?
A2intA2b;A2forA2(intA2iMusA2=A20;A2iMusA2<A25;A2iMus+

Written for

Institution
CSCE 102
Course
CSCE 102

Document information

Uploaded on
November 21, 2025
Number of pages
2
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$10.99
Get access to the full document:

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

Get to know the seller
Seller avatar
LECTUREKIM

Also available in package deal

Thumbnail
Package deal
COMPUTER PROGRAMMING EXAM 2 QUESTIONS AND CORRECT ANSWERS
-
4 2025
$ 46.96 More info

Get to know the seller

Seller avatar
LECTUREKIM stuvia
View profile
Follow You need to be logged in order to follow users or courses
Sold
6
Member since
4 months
Number of followers
0
Documents
3033
Last sold
4 weeks ago

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Trending documents

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 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

Frequently asked questions