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

COMP EXAM 4 QUESTIONS AND ANSWER

Rating
-
Sold
-
Pages
3
Grade
A+
Uploaded on
27-12-2025
Written in
2025/2026

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.

Show more Read less
Institution
COMP
Course
COMP








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

Written for

Institution
COMP
Course
COMP

Document information

Uploaded on
December 27, 2025
Number of pages
3
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

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

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.
STANGRADES Stanford University
View profile
Follow You need to be logged in order to follow users or courses
Sold
48
Member since
1 year
Number of followers
1
Documents
9506
Last sold
5 days ago
STAN-GRADES

EXCELLENCY IN ACADEMIC MATERIALS

3.4

11 reviews

5
4
4
1
3
3
2
1
1
2

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