
Flashcard on Accumulators and Sentinel Values

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

7 questions
Show all answers
1.
FLASHCARD QUESTION
Front
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.
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 Wayground
10 questions
Guess the Word

Flashcard
•
Professional Development
14 questions
LETTER 1

Flashcard
•
KG
10 questions
Dominio y Composición de Funciones

Flashcard
•
University
10 questions
Segment Addition Postulate

Flashcard
•
9th - 12th Grade
8 questions
Beginning sounds

Flashcard
•
KG
7 questions
basic hangul review

Flashcard
•
KG - Professional Dev...
13 questions
Tk Membaca lengkapi huruf l-z calistung privat malang

Flashcard
•
KG
8 questions
Turbo Trivia

Flashcard
•
University
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Hospitality and Catering
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
20 questions
Getting to know YOU icebreaker activity!

Quiz
•
6th - 12th Grade
10 questions
Impact of 9/11 and the War on Terror

Interactive video
•
10th - 12th Grade
28 questions
Ser vs estar

Quiz
•
9th - 12th Grade
6 questions
Biography

Quiz
•
4th - 12th Grade
25 questions
ServSafe Foodhandler Part 3 Quiz

Quiz
•
9th - 12th Grade
10 questions
Fact Check Ice Breaker: Two truths and a lie

Quiz
•
5th - 12th Grade
20 questions
Macromolecules

Quiz
•
9th - 12th Grade