• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 1 out of 3 pages
Exam (elaborations)

COMP EXAM 4 QUESTIONS AND ANSWER

Document preview thumbnail
Preview 1 out of 3 pages

COMP EXAM 4 QUESTIONS AND ANSWERS loop/ loop body - CORRECT ANSWERa 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.

Content preview

COMP EXAM 4 QUESTIONS AND ANSWERS
loop/ loop body - CORRECT ANSWER✅✅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.



iteration - CORRECT ANSWER✅✅Each time through a loop's statements



while loop - CORRECT ANSWER✅✅a program construct that repeatedly executes a list of sub-
statements (known as the loop body) while the loop's expression evaluates to true



infinite loop - CORRECT ANSWER✅✅a loop that never stops iterating



sentinel value - CORRECT ANSWER✅✅a special value indicating the end of a list, such as a list of
positive integers ending with 0 (ex: 10, 1, 6, 3, 0)



index - CORRECT ANSWER✅✅each string character has a position number called an index, starting with
0 (ex: the S in String is at index 0 and the t is at 1)



at() - CORRECT ANSWER✅✅the notation someString.at(x) accesses the character at the index x of a
string



size() - CORRECT ANSWER✅✅the function someString.size() returns a string's length (ex: if s1 is "Hey",
s1.size() returns 3)



append - CORRECT ANSWER✅✅the function s1.append(s2) adds string 2 to the end of string 1 (ex: if s1
is "Hey" and s2 is "!!!", it makes s1 "Hey!!!")



exception - CORRECT ANSWER✅✅a detected runtime error that commonly prints an error message and
terminates the program

Document information

Uploaded on
December 27, 2025
Number of pages
3
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.
STANGRADES
3.4
(14)
Sold
96
Followers
2
Items
12022
Last sold
1 week 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