
Quiz on Accumulators and Sentinel Values
Authored by Janet (SR)
Hospitality and Catering
12th Grade
10 Questions
Used 2+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
1.
MULTIPLE SELECT QUESTION
30 sec • 1 pt
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) _____.
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
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
Leadership in Human Resource Management
Quiz
•
10th Grade - University
15 questions
2-18 Seafood Quiz
Quiz
•
12th Grade
15 questions
LAHS FOOD LAB Culinary Review Game
Quiz
•
9th - 12th Grade
15 questions
Appetizer Exit Assessment
Quiz
•
12th Grade
12 questions
LC Service Training
Quiz
•
12th Grade
15 questions
Unit 214 Produce Paste Products
Quiz
•
12th Grade - University
15 questions
Characteristics of Ingredients
Quiz
•
10th Grade - University
10 questions
Cooking Methods and Measurements Quiz
Quiz
•
12th Grade
Popular Resources on Wayground
5 questions
This is not a...winter edition (Drawing game)
Quiz
•
1st - 5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Identify Iconic Christmas Movie Scenes
Interactive video
•
6th - 10th Grade
20 questions
Christmas Trivia
Quiz
•
6th - 8th Grade
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
11 questions
How well do you know your Christmas Characters?
Lesson
•
3rd Grade
14 questions
Christmas Trivia
Quiz
•
5th Grade
20 questions
How the Grinch Stole Christmas
Quiz
•
5th Grade
Discover more resources for Hospitality and Catering
26 questions
Christmas Movie Trivia
Lesson
•
8th Grade - Professio...
15 questions
Christmas Song Emoji Pictionary
Quiz
•
7th - 12th Grade
20 questions
Christmas Movies
Quiz
•
1st - 12th Grade
55 questions
CHS Holiday Trivia
Quiz
•
12th Grade
20 questions
Christmas Movie Trivia
Quiz
•
9th - 12th Grade
29 questions
christmas facts
Lesson
•
5th - 12th Grade
20 questions
Christmas Trivia
Quiz
•
5th - 12th Grade
20 questions
Stages of Meiosis
Quiz
•
9th - 12th Grade