Kuizi 12 - Web

Kuizi 12 - Web

10th Grade

15 Qs

quiz-placeholder

Similar activities

G3M6

G3M6

10th Grade

10 Qs

Scratch Programming

Scratch Programming

1st - 12th Grade

13 Qs

P5.js Conditional Statements in Computer Science

P5.js Conditional Statements in Computer Science

9th - 12th Grade

20 Qs

Unit 3 Lesson 1 Using Expressions

Unit 3 Lesson 1 Using Expressions

10th Grade

10 Qs

Python basics about tokens and arithmetic operators

Python basics about tokens and arithmetic operators

9th - 10th Grade

12 Qs

Programming Language Errors and Operators

Programming Language Errors and Operators

9th - 12th Grade

15 Qs

Python Programming Basics Quiz

Python Programming Basics Quiz

9th - 12th Grade

20 Qs

Python Strings

Python Strings

8th - 12th Grade

14 Qs

Kuizi 12 - Web

Kuizi 12 - Web

Assessment

Quiz

Computers

10th Grade

Hard

Created by

Shkodran Hasani

FREE Resource

AI

Enhance your content

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the syntax for an if statement in JavaScript?

if condition { // code to execute }

if (condition) // code to execute

if (condition) { // code to execute }

if { condition } // code to execute

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you write an if-else statement?

if (condition) { // code } else if { // code }

if condition then { // code } else { // code }

if (condition) { // code to execute if condition is true } else { // code to execute if condition is false }

if (condition) { // code } else { // execute code }

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will the following code output: if (5 > 3) { console.log('True'); }?

Error

Undefined

False

True

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of a switch statement?

To define a variable's scope

To handle exceptions in programming

To create loops in code

The purpose of a switch statement is to execute different code blocks based on the value of a variable or expression.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you define a default case in a switch statement?

Use 'case default:' to define the default case.

You can omit the default case entirely in a switch statement.

Use 'default:' followed by the code block.

The default case is defined with 'default_case:' syntax.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will the following switch statement output: switch (2) { case 1: console.log('One'); break; case 2: console.log('Two'); break; }?

Two

One

Zero

Three

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the syntax for a ternary operator?

condition ? result_if_false : result_if_true

result_if_true : condition ? result_if_false

result_if_true ? result_if_false : condition

condition ? result_if_true : result_if_false

Create a free account and access millions of resources

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?