What is the correct way to write a Karel Command called move?
move();
Using the words USER and AGE, what is the proper way to use this as a variable name?
userAge
How many values doe a boolean statements have, and what are they?
2, True & False.
Say you want to write a program to have Karel put down 300 tennis balls, which control structure would you use?
For loop
break down code, avoid repeating code, make code more readable.
What HTML element names the webpage Tab?
Title
A store has 20 apples in its inventory, How can you store this information using a JS variable?
var numApples = 20;
What symbol(s) represent the and operator in JS?
&&
What is the purpose of using a for loop in code?
How can we teach a program a new command?
Define a new function
What is the name of the HTML element that allows a programmer to utilize a hyperlink?
Anchor element
You want to read input from a user, how would you ask the user the number of apples to buy using JS? (use the variable appleToBuy)
var appleToBuy = readInt("How many apples would you like");
What symbol(s) represent the or operator in JS?
||
How many times will the following program print "hello"?
for (var i = 0; i < 5; i++){
println("hello");
}
5
What is the correct way to define turnRight in Karel?
function turnRight(){
turnLeft();
turnLeft();
turnLeft();
}
Img
You are splitting up all your apples between 3 people. How would you use a variable and numbers to calculate the left over apples? (use var leftOver)
var leftOver = numbApples % 3;
What kind of statement allows us to run a block code only if a certain conditions is true?
If statement
What math symbol allows us to calculate the remainder when using JavaScript? What is its name?
% = modulus
In this code, how many times is the "dance" function called and how many times is it defined?
Called 3 times, defined 1
Write Valid CSS for the h1 element turing the text a blue color.
h1 {
color: blue;
}
What number would be printed with this code being run?
var num = 13 % 3;
println(num);
1
When the following code is ran, what is the value of "isWeekend"?
var isSaturday = true;
var isSunday = false;
var isWeekend = isSaturday || isSunday;
True
What day is the final in this class?
Thursday