Font size
WorksheetsJS If Then Else
Total questions: 15
Worksheet time: 8mins
What type of blocks do we use in scratch to create a true false condition
Boolean
Kinetic
Potential
Equilateral
Mia creates a boolean block for
"Moby wearing a hat"
and sets its value to "false."
Which picture matches her boolean block?
How many values does a Boolean variable have?
4
3
2
1
Infinite
The "If" Statement is an example of a _________________
Correctional Statement
Competitive Statement
Conditional Statement
Inquisitive Statement
If it is sunny and windy
It is a good day to go on a picnic!
Else if it is rainy and cold
It is a good day to stay inside!
Else
It is a good day to drink hot chocolate!
If I drank hot chocolate, then what happened?
It was sunny and windy
It was rainy and cold
Neither sunny, windy, rainy, or cold
It was sunny and cold
Pieces of code that only run "under certain conditions":
conditional statements
control flow statments
syntax
variables
Which of these are correct methods to create a function?
function myFunction {
// Some code }
function myFunction[] {
// Some code }
function myFunction() {
// Some code }
function myFunction(x, y, z) {
// Some code }
A reusable block of code that groups together a sequence of statements to perform a specific task.
Function
Identifier
Argument
Blocks
What is the syntax for creating a function in JavaScript named as Geekfunc?
A) function = Geekfunc()
B) function Geekfunc()
C) function := Geekfunc()
D) function : Geekfunc()
Which of the following is NOT a valid component of a function declaration?
Function keyword
Function name
Pair of Square Braces
Pair of Curly Braces
What is the name of this function?
function
spin()
3 turnLeft();
spin();
Which one of the following symbols is used for JavaScript comments? / Lequel des symboles suivants est utilisé pour les commentaires JavaScript?
\\
^
?
//
var typeOfApples="Fuji";
var numApples = 2;
