JavaScript Control Structures Quiz Unit 5 Test A

JavaScript Control Structures Quiz Unit 5 Test A

11th Grade

15 Qs

quiz-placeholder

Similar activities

CodeHS Functions and Return Values

CodeHS Functions and Return Values

9th - 12th Grade

15 Qs

Basic JavaScript Review

Basic JavaScript Review

9th - 12th Grade

20 Qs

JavaScript Knowledge & Skills

JavaScript Knowledge & Skills

9th - 12th Grade

15 Qs

P5.js Conditional Statements in Computer Science

P5.js Conditional Statements in Computer Science

9th - 12th Grade

15 Qs

Control Structures

Control Structures

9th - 12th Grade

20 Qs

Functions and Parameters Quiz

Functions and Parameters Quiz

9th - 12th Grade

15 Qs

CodeHS Functions and Parameters

CodeHS Functions and Parameters

9th - 12th Grade

15 Qs

JavaScript Control Structures Quiz Unit 5 Test A

JavaScript Control Structures Quiz Unit 5 Test A

Assessment

Quiz

Computers

11th Grade

Hard

Created by

Joseph Armanious

FREE Resource

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the value of the boolean variable canVote at the end of this program?

True

False

Yes

none, there is a syntax error in this code

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of this program? var number = 5; var greater_than_zero = number > 0; if (greater_than_zero){ println(number); }

0

5

True

Nothing will print

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of this program?

0

5

True

Nothing will print

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is printed by the following program? var isRaining = false; var isCloudy = false; var isSunny = !isRaining && !isCloudy; var isSummer = false; var isWarm = isSunny || isSummer; println("Is it warm: " + isWarm);

Is it warm: true

Is it warm: false

Is it warm: yes

Is it warm: no

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is printed by the following program? var numApples = 10; var numOranges = 5; if(numApples < 20 || numOranges == numApples){ println("Hello, we are open!"); } else { println("Sorry, we are closed!"); } println("Sincerely, the grocery store");

Hello, we are open!

Sorry, we are closed!

Sincerely, the grocery store

Hello, we are open! Sincerely, the grocery store

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will the following program print when run? var above16 = true; var hasPermit = true; var passedTest = false; if (above16 && hasPermit && passedTest){ println("Issue Driver's License"); } else { if (above16 || hasPermit || passedTest) { println("Almost eligible for Driver's License"); } else { println("No requirements met."); } }

Issue Driver’s License

Almost eligible for Driver’s License

No requirements met.

Nothing will print

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code? printIn(4); } if (numberOne != numberTwo) { printIn(5); }

1

1 3 5

1 4

1 4 5

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?