Enhanced For Loops

Flashcard
•
Computers
•
10th - 12th Grade
•
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);
Similar Resources on Wayground
14 questions
AP CS ArrayLists

Flashcard
•
12th Grade
4 questions
MethodHeadingChecker

Flashcard
•
12th Grade
11 questions
Section 8 Vocabulary

Flashcard
•
9th - 12th Grade
15 questions
math

Flashcard
•
KG - University
5 questions
Arrays

Flashcard
•
11th Grade
11 questions
Java ArrayLists

Flashcard
•
10th Grade
10 questions
AP CSP Vocabulary Flashcard

Flashcard
•
12th Grade
11 questions
Algebra 2 EOC

Flashcard
•
11th Grade
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

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

Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
US Constitution Quiz

Quiz
•
11th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
20 questions
Analog vs Digital

Quiz
•
9th - 12th Grade
10 questions
CTEA Computer Vocab Terms #1

Quiz
•
12th Grade
10 questions
Exploring Cybersecurity Techniques and Threats

Interactive video
•
6th - 10th Grade
10 questions
Understanding the Internet and Data Transmission

Interactive video
•
7th - 12th Grade