

Flashcard on Accumulators and Sentinel Values
Flashcard
•
Hospitality and Catering
•
12th Grade
•
Practice Problem
•
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
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
10 questions
Evolve 2 Unit - 8 Flashcard - 1
Flashcard
•
University
10 questions
Rekod Tak Lengkap Kaedah Perbandingan
Flashcard
•
University
10 questions
Practica 1 mecanismos de defensa
Flashcard
•
University
7 questions
Simple present tense
Flashcard
•
11th Grade
8 questions
ADVF CCP1
Flashcard
•
Professional Development
8 questions
INSIGNIAS Y DISTINTIVOS CEREMAR
Flashcard
•
University
2 questions
5.3 Forecasting and Managing Cashflows Flashcards
Flashcard
•
12th Grade
7 questions
Teorías atómicas
Flashcard
•
11th Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
10 questions
Probability Practice
Quiz
•
4th Grade
15 questions
Probability on Number LIne
Quiz
•
4th Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
6 questions
Appropriate Chromebook Usage
Lesson
•
7th Grade
10 questions
Greek Bases tele and phon
Quiz
•
6th - 8th Grade
Discover more resources for Hospitality and Catering
15 questions
Making Inferences
Quiz
•
7th - 12th Grade
23 questions
TSI Math Vocabulary
Quiz
•
10th - 12th Grade
20 questions
-AR -ER -IR present tense
Quiz
•
10th - 12th Grade
20 questions
SSS/SAS
Quiz
•
9th - 12th Grade
20 questions
Predicting Products
Quiz
•
9th - 12th Grade
20 questions
Presidents Day challenge
Quiz
•
9th - 12th Grade
20 questions
Food Chains and Food Webs
Quiz
•
7th - 12th Grade
20 questions
Banking
Quiz
•
9th - 12th Grade