A(n) _____ value is a special value that cannot be mistaken as a member of the list, and signals that there are no more values to be entered. When the user enters the sentinel value, the loop terminates.

Flashcard on Accumulators and Sentinel Values

Flashcard
•
Hospitality and Catering
•
12th Grade
•
Hard
Quizizz Content
FREE Resource
Student preview

7 questions
Show all answers
1.
FLASHCARD QUESTION
Front
Back
sentinel
2.
FLASHCARD QUESTION
Front
The logic for calculating a sum of numbers generally requires the accumulator variable to be set to _____ otherwise the total may not be correct when the loop finishes.
Back
0
3.
FLASHCARD QUESTION
Front
A sentinel value is always included (summed) in the running total of an app that accumulates.
Back
False
4.
FLASHCARD QUESTION
Front
The best choice for a sentinel used in a program that sums the number of free throws made in an NBA playoff basketball game is 3 (assume Shaq is not playing).
Back
False
5.
FLASHCARD QUESTION
Front
-1 is not an ideal choice for a sentinel used to sum the number of days it is hot in the Sahara desert.
Back
False
6.
FLASHCARD QUESTION
Front
In the following program segment, which variable is the "loop control variable" (also known as the counter variable)? int a, r = 0, g = 0; while (r < 21) { g = r * 2; a += g; r++; } System.out.println("The sum is " + g);
Back
r
7.
FLASHCARD QUESTION
Front
In the following program segment, which is a VALID Java accumulator? int a, r, h = 1; g = 0; while (r < 21) { a = r * 2; g += a + h; r--; } System.out.println("The sum is " + g);
Back
g
Similar Resources on Quizizz
10 questions
DENR-CAR Environmental Flashcard (INTERMEDIATE ROUND)

Flashcard
•
KG
5 questions
Enhanced For Loops

Flashcard
•
10th - 12th Grade
6 questions
Раунд 11

Flashcard
•
University
10 questions
Flashcard on Shapes and Functions

Flashcard
•
12th Grade
9 questions
4-3 Relations A

Flashcard
•
9th - 12th Grade
10 questions
Module 07 - While Loops

Flashcard
•
10th Grade
10 questions
Phonics Flashcard

Flashcard
•
Professional Development
15 questions
Polar graphing

Flashcard
•
11th - 12th Grade
Popular Resources on Quizizz
20 questions
math review

Quiz
•
4th Grade
20 questions
Math Review - Grade 6

Quiz
•
6th Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
20 questions
Taxes

Quiz
•
9th - 12th Grade
10 questions
Human Body Systems and Functions

Interactive video
•
6th - 8th Grade
19 questions
Math Review

Quiz
•
3rd Grade
45 questions
7th Grade Math EOG Review

Quiz
•
7th Grade
Discover more resources for Hospitality and Catering
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
20 questions
Taxes

Quiz
•
9th - 12th Grade
20 questions
Investing

Quiz
•
9th - 12th Grade
20 questions
Insurance

Quiz
•
9th - 12th Grade
20 questions
Paying for College

Quiz
•
9th - 12th Grade
20 questions
Banking

Quiz
•
9th - 12th Grade
20 questions
Managing Credit

Quiz
•
9th - 12th Grade
20 questions
-AR -ER -IR present tense

Quiz
•
10th - 12th Grade