Worksheets1.2
Total questions: 19
Worksheet time: 17mins
What is pseudocode primarily used for?
To write executable code
To display output on the screen
To plan a program's flow and structure
To store data in variables
Which symbol is used as the assignment operator in pseudocode?
->
=
<-
:=
What does the DISPLAY() function do in pseudocode?
Updates the value of a variable
Assigns a value to a variable
Prints a value on the output screen
Stores a value in a variable
Which data type would be appropriate for storing a student's age?
String
Boolean
Number
List
What is the purpose of meaningful variable names?
To increase execution speed
To make the code shorter
To avoid confusion about what they represent
To follow programming conventions
In JavaScript, which keyword is used to declare a constant variable?
let
define
var
const
What is the output of console.log('Hello' + ' World') in JavaScript?
Hello World
HelloWorld
Hello + World
Error
Which function is used to obtain user input in JavaScript?
prompt()
input()
getInput()
scan()
What type of comments are used for single-line comments in JavaScript?
//
/*
#
Which of the following is NOT a data type in JavaScript?
String
Number
Character
Boolean
What will happen if you try to reassign a constant variable in JavaScript?
The program will ignore it
An error will occur
The value will change
The variable will be deleted
Which of the following is a valid way to declare a variable in JavaScript?
const name;
let name;
All of the above
var name;
What does the parseInt() function do in JavaScript?
Parses JSON data
Converts a string to an integer
Converts an integer to a string
None of the above
Which of the following is a correct way to display a variable in JavaScript?
console.log(variable);
print(variable);
display(variable);
echo variable;
What are the four suggestions when naming a variable?
How are data types in pseudocode different than in JavaScript?
What is the extension for a JavaScript file?
.java
.jar
.js
.sj
What output will this code generate?
let number = 5;
console.log(number);
number = 10;
console.log(number);
To convert any string to a whole number what do we use?
parseInt
parseFloat
parseCon
None of the above
