Unit 4 Quiz 2 Review

Unit 4 Quiz 2 Review

9th - 12th Grade

24 Qs

quiz-placeholder

Similar activities

SDA uCertify Chapter 8 Mid-Chapter Quiz

SDA uCertify Chapter 8 Mid-Chapter Quiz

8th - 12th Grade

20 Qs

uCertify JavaScript Chapter 5

uCertify JavaScript Chapter 5

9th - 12th Grade

20 Qs

Karel Quiz

Karel Quiz

8th - 12th Grade

22 Qs

JavaScript Basics CodeHS

JavaScript Basics CodeHS

7th - 12th Grade

20 Qs

CodeHS JavaScript

CodeHS JavaScript

8th - 12th Grade

21 Qs

G10 | Java - Unit Test 01

G10 | Java - Unit Test 01

10th Grade

20 Qs

COM10.3.1

COM10.3.1

10th Grade

20 Qs

IST CodeHS Unit 2 Robot Coding Review

IST CodeHS Unit 2 Robot Coding Review

9th - 12th Grade

20 Qs

Unit 4 Quiz 2 Review

Unit 4 Quiz 2 Review

Assessment

Quiz

Computers

9th - 12th Grade

Medium

Created by

Bret Dillon

Used 7+ times

FREE Resource

24 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which general for loop definition is written correctly?

for(true)

{

// code

}

if(i<5)

{

// code

}

for(int i = 0; i < count; i++)

{

// code

}

while(condition)

{

// code

}

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Why do we use for loops in Java?

To break out of some block of code

To do something if a condition is true


To do something while a condition is true


To repeat something for a fixed number of times

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Why do we use while loops in Java?

To break out of some block of code

To do something if a condition is true

To repeat some code while a condition is true

To repeat something for a fixed number of times

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which general while loop definition is written correctly?

while(x is true)

{

// code

}

if(i<5)

{

// code

}

while(int i = 0; i < count; i++)

{

// code

}

while(condition)

{

// code

}

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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

Helps shorten the code

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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


Before defining the run method


Always on their own line


Right after defining a method


Two brackets per line

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Why do we use if statements in Java?


To break out of some block of code


To do something only if a condition is true

To do something while a condition is true

To repeat something for a fixed number of times

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?