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
9 questions
CSA Semester 2 Final

Flashcard
•
11th - 12th Grade
9 questions
عناوين العمليات بلغة جافا

Flashcard
•
10th Grade - University
7 questions
Java Data Types Practice

Flashcard
•
12th Grade
9 questions
Alg1 M14L1 Vocabulary - Measures of Center & Variation

Flashcard
•
9th - 12th Grade
5 questions
Arrays

Flashcard
•
11th Grade
5 questions
Arrays

Flashcard
•
11th Grade
5 questions
Arrays

Flashcard
•
11th Grade
10 questions
❄⛄AP CSA - Unit 6 Review

Flashcard
•
9th - 12th Grade
Popular Resources on Wayground
18 questions
Writing Launch Day 1

Lesson
•
3rd Grade
11 questions
Hallway & Bathroom Expectations

Quiz
•
6th - 8th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
19 questions
Handbook Overview

Lesson
•
9th - 12th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
Discover more resources for Computers
40 questions
Algebra Review Topics

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

Interactive video
•
6th - 10th Grade
19 questions
Handbook Overview

Lesson
•
9th - 12th Grade
40 questions
LSHS Student Handbook Review: Pages 7-9

Quiz
•
11th Grade
10 questions
Characteristics of Life

Quiz
•
9th - 10th Grade
10 questions
Essential Lab Safety Practices

Interactive video
•
6th - 10th Grade
20 questions
Scalars, Vectors & Graphs

Quiz
•
11th Grade
62 questions
Spanish Speaking Countries, Capitals, and Locations

Quiz
•
9th - 12th Grade