Unit 4 Flashcard 2

Unit 4 Flashcard 2

Assessment

Flashcard

Created by

Quizizz Content

Computers

9th - 12th Grade

Hard

Student preview

quiz-placeholder

20 questions

Show all answers

1.

FLASHCARD QUESTION

Front

Which general for loop definition is written correctly? Options: for(true) { // code } , if(i<5) { // code } , for(int i = 0; i < count; i++) { // code } , while(condition) { // code }

Back

for(int i = 0; i < count; i++) { // code }

2.

FLASHCARD QUESTION

Front

Why do we use for loops in Java?

Back

To repeat something for a fixed number of times

3.

FLASHCARD QUESTION

Front

Why do we use while loops in Java?

Back

To repeat some code while a condition is true

4.

FLASHCARD QUESTION

Front

Which general while loop definition is written correctly? Options: while(x is true) { // code } , if(i<5) { // code } , while(int i = 0; i < count; i++) { // code } , while(condition) { // code }

Back

while(condition) { // code }

5.

FLASHCARD QUESTION

Front

What is NOT a reason a programmer should indent their code?
Helps show the structure of the code,
Easier for other people to understand,
Indenting is a key part of good programming style,

Back

Helps shorten the code

6.

FLASHCARD QUESTION

Front

To maintain good style, where should brackets go in Java programming?

Back

Always on their own line

7.

FLASHCARD QUESTION

Front

Why do we use if statements in Java?

Back

To do something only if a condition is true

Explore all questions with a free account

or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?