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

D278 section 4 Question and answers correctly solved 2025/2026

Document preview thumbnail
Preview 2 out of 5 pages

D278 section 4 Question and answers correctly solved 2025/2026

Content preview

D278 section 4 Question and answers correctly solved
2025/2026

1. loop is a program construct that repeatedly executes the loop's statements
(known as the loop body) while the loop's expression is true; when
false, execution proceeds past the loop.

2. iteration true; when false, execution proceeds past the loop.

3. Common error is to use the opposite loop expression than desired, like using x == 0
in loops rather than x
!= 0. Programmers should remember that the expression describes
when the loop should iterate, not when the loop should exit.

4. infinite loop is a loop that never stops iterating. A common error is to accidentally
create an infinite loop, often by forgetting to update a variable in the body,
or by creating a loop expression whose evaluation to false isn't always
reachable.

5. sentinel value is a special value indicating the end of a list, such as a list of positive
integers ending with 0, as in 10 1 6 3 0.

6. while loop is a loop that repeatedly executes the loop body while the loop's
expression
evaluates to true

7. for loop is a loop consisting of a loop variable initialization, a loop expression,
and a loop variable update that typically describes iterating for a
specific number of times.

8. for Number of iterations is computable before the loop, like iterating N times.

9. while Number of iterations is not (easily) computable before the loop, like iterating
until the input is 'q'.

10. nested loop is a loop that appears in the body of another loop. The nested loops are

1/
5

, D278 section 4 Question and answers correctly solved
2025/2026
commonly referred to as the inner loop and outer loop.

11. while loop A while loop repeatedly executes the loop body while the loop's
expression evalu- ates to true.




2/
5

Document information

Uploaded on
September 5, 2025
Number of pages
5
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$16.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.
STUVIAMAESTRO254
2.6
(40)
Sold
168
Followers
98
Items
9654
Last sold
1 month 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