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 2 out of 6 pages
Exam (elaborations)

CSE 1321 LATEST ACTUAL 2026/2027 EXAM QUESTIONS AND SOLUTIONS RATED A+

Document preview thumbnail
Preview 2 out of 6 pages

CSE 1321 LATEST ACTUAL 2026/2027 EXAM QUESTIONS AND SOLUTIONS RATED A+

Content preview

CSE 1321 LATEST ACTUAL 2026/2027 EXAM QUESTIONS
AND SOLUTIONS RATED A+
✔✔Imagine a game of Yahtzee where a roll of dice always returns an even number.
Consider this code where the number is variable that stores the value of the dice.

BEGIN MAIN
CREATE result = number % 2;
IF (result == 0)
PRINT "TRUE"
ELSE
PRINT "FALSE"
END MAIN

What will the code display?

a) FALSE
b) Unable to determine
c) Neither condition is satisfied
d) TRUE - ✔✔d) TRUE

✔✔An if statement does not need to have an else clause.

true or false - ✔✔true

✔✔If the variable isTested is a Boolean, then the statement below is a valid control
expression:

IF(isTested)

true or false - ✔✔true

✔✔In programming && is considered an arithmetic operator.

true or false - ✔✔false

✔✔If x = 3, y = 1, and z = 5 then the following Boolean expression evaluates to true:

( x > 0) && (y == 0) || (z < 5)

true or false - ✔✔false

✔✔The Boolean expression ((A AND B) AND (NOT(A AND B)) evaluates to:

a) true whenever both A is true and B is true.

, b) false in all cases.
c) true whenever only A is true or only B is true.
d) true in all cases. - ✔✔b) false in all cases.

✔✔Which statement below will be true after the following code terminates?

BEGIN MAIN
CREATE x = 0
WHILE (x < 100)
{
x *= 2;
}
END WHILE
END MAIN

a) x == 98
b) x == 2
c) The loop won't terminate. It's an infinite loop.
d) x == 0 - ✔✔c) The loop won't terminate. It's an infinite loop.

(0 * 2 will always be 0 so infinite loop)

✔✔Consider this code:

BEGIN MAIN
int y=1;
int x=1;
PRINTLINE(x++);
END MAIN

What will this code print?

a) 2
b) 0
c) 1
d) unknown - ✔✔c) 1

✔✔A relational operator used when comparing primitive data types is !=.

true or false - ✔✔true

✔✔A switch statement is similar to an if statement in that both are used to alter the flow
of a program.

true or false - ✔✔true

Document information

Uploaded on
April 7, 2026
Number of pages
6
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.
EXAMCAFE
3.4
(19)
Sold
156
Followers
7
Items
26055
Last sold
2 days 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