A(n) _____ is a sum of numbers that accumulates with each iteration of a loop. The variable used to keep the running total is called a(n) _____.

Quiz on Accumulators and Sentinel Values

Quiz
•
Hospitality and Catering
•
12th Grade
•
Medium
Janet (SR)
Used 2+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE SELECT QUESTION
30 sec • 1 pt
gross; net
net; gross
accumulator; running total
earnings; balance
running total; accumulator
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
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.
sentinel
bullseye
signal
sentry
sargent
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
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.
1
10
-1
2
0
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
A sentinel value is always included (summed) in the running total of an app that accumulates.
True
False
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
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).
True
False
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
-1 is not an ideal choice for a sentinel used to sum the number of days it is hot in the Sahara desert.
True
False
7.
OPEN ENDED QUESTION
3 mins • 1 pt
Write a for loop that repeats four times, asking the user to enter a lottery ticket powerball number. Use the variable powerball in your code/response that stores the input value from keyboard.nextInt(). The loop should also calculate the sum of the value numbers entered (like the sum of 32 + 6 + 23 + 19). Assume all related code not provided prior to Scanner is valid.
Evaluate responses using AI:
OFF
Create a free account and access millions of resources
Similar Resources on Wayground
15 questions
MAPEH 4 Review Quiz

Quiz
•
4th Grade - University
15 questions
Room Service Call Quiz

Quiz
•
12th Grade
15 questions
Introduction to Hospitality Management

Quiz
•
12th Grade - University
10 questions
Explore Cultural Heritage Sites

Quiz
•
10th Grade - University
10 questions
Legumes Quiz

Quiz
•
12th Grade
15 questions
HIgh on the Hog Pt. 1

Quiz
•
9th - 12th Grade
15 questions
Culinary Knowledge Quiz

Quiz
•
12th Grade
9 questions
Baked Good Ingredients - What's their function?

Quiz
•
9th - 12th Grade
Popular Resources on Wayground
25 questions
Equations of Circles

Quiz
•
10th - 11th Grade
30 questions
Week 5 Memory Builder 1 (Multiplication and Division Facts)

Quiz
•
9th Grade
33 questions
Unit 3 Summative - Summer School: Immune System

Quiz
•
10th Grade
10 questions
Writing and Identifying Ratios Practice

Quiz
•
5th - 6th Grade
36 questions
Prime and Composite Numbers

Quiz
•
5th Grade
14 questions
Exterior and Interior angles of Polygons

Quiz
•
8th Grade
37 questions
Camp Re-cap Week 1 (no regression)

Quiz
•
9th - 12th Grade
46 questions
Biology Semester 1 Review

Quiz
•
10th Grade