Enhanced For Loops
Flashcard
•
Computers
•
10th - 12th Grade
•
Practice Problem
•
Hard
Wayground Content
FREE Resource
Student preview

5 questions
Show all answers
1.
FLASHCARD QUESTION
Front
What is the correct code to put in place of /*******/ in the Enhanced For Loop to sum all the values in an array of ints called values ?
int sum = 0;
for(int value: /*******/)
{
sum = sum + value;
}
Back
values
2.
FLASHCARD QUESTION
Front
What is the correct code to put in place of /*******/ in the Enhanced For Loop to sum all the values in an array of ints called values ?
int sum = 0;
for( /*******/ : values)
{
sum = sum + value;
}
Back
int value
3.
FLASHCARD QUESTION
Front
Assume that an array of ints called values has been initialized. We want to write an Enhanced For Loop to sum all the values. What is the correct code to put in place of /*******/
int sum = 0;
for( int value : values)
{
/*******/
}
Back
sum += value;
4.
FLASHCARD QUESTION
Front
What is the correct code for an enhanced for loop to say Hello to each name in the array of Strings called friends?
for(/*********/)
{
System.out.println("Hello " + friend);
}
Back
String friend:friends
5.
FLASHCARD QUESTION
Front
Assume that an array of Strings called friends has been created and initialized. We want to write an enhanced for loop that says Hello to each name in the array. What is the correct code that goes in place of /*********/? for(String friend:friends) { /***********/ }
Back
System.out.println("Hello " + friend);
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
15 questions
Math 3 EOC Review
Flashcard
•
9th - 11th Grade
15 questions
2.8a Angle Addition Postulate
Flashcard
•
10th Grade
15 questions
ACP Geometry Flashcard
Flashcard
•
10th Grade
15 questions
SpringBoard: Flashcard 3
Flashcard
•
10th Grade
6 questions
Konektory
Flashcard
•
9th - 12th Grade
8 questions
Attachment Theory Flashcard
Flashcard
•
12th Grade
14 questions
Gilded Age Vocabulary
Flashcard
•
11th Grade
15 questions
Chapter 3 and 4- ECOLOGY EXAM
Flashcard
•
10th Grade - University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade