Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

1.2

Total questions: 19

Worksheet time: 17mins

Name
Class
Date
1.

What is pseudocode primarily used for?

a)

To write executable code

b)

To display output on the screen

c)

To plan a program's flow and structure

d)

To store data in variables

2.

Which symbol is used as the assignment operator in pseudocode?

a)

->

b)

=

c)

<-

d)

:=

3.

What does the DISPLAY() function do in pseudocode?

a)

Updates the value of a variable

b)

Assigns a value to a variable

c)

Prints a value on the output screen

d)

Stores a value in a variable

4.

Which data type would be appropriate for storing a student's age?

a)

String

b)

Boolean

c)

Number

d)

List

5.

What is the purpose of meaningful variable names?

a)

To increase execution speed

b)

To make the code shorter

c)

To avoid confusion about what they represent

d)

To follow programming conventions

6.

In JavaScript, which keyword is used to declare a constant variable?

a)

let

b)

define

c)

var

d)

const

7.

What is the output of console.log('Hello' + ' World') in JavaScript?

a)

Hello World

b)

HelloWorld

c)

Hello + World

d)

Error

8.

Which function is used to obtain user input in JavaScript?

a)

prompt()

b)

input()

c)

getInput()

d)

scan()

9.

What type of comments are used for single-line comments in JavaScript?

a)

//

c)

/*

d)

#

10.

Which of the following is NOT a data type in JavaScript?

a)

String

b)

Number

c)

Character

d)

Boolean

11.

What will happen if you try to reassign a constant variable in JavaScript?

a)

The program will ignore it

b)

An error will occur

c)

The value will change

d)

The variable will be deleted

12.

Which of the following is a valid way to declare a variable in JavaScript?

a)

const name;

b)

let name;

c)

All of the above

d)

var name;

13.

What does the parseInt() function do in JavaScript?

a)

Parses JSON data

b)

Converts a string to an integer

c)

Converts an integer to a string

d)

None of the above

14.

Which of the following is a correct way to display a variable in JavaScript?

a)

console.log(variable);

b)

print(variable);

c)

display(variable);

d)

echo variable;

15.

What are the four suggestions when naming a variable?

4 lines
16.

How are data types in pseudocode different than in JavaScript?

4 lines
17.

What is the extension for a JavaScript file?

a)

.java

b)

.jar

c)

.js

d)

.sj

18.

What output will this code generate?

let number = 5;

console.log(number);

number = 10;

console.log(number);

4 lines
19.

To convert any string to a whole number what do we use?

a)

parseInt

b)

parseFloat

c)

parseCon

d)

None of the above