Basic JavaScript Math and Graphics Miscellaneous JS booleans, comparison and logical operators Foor Loops
100
What is a string?
println("Hello world.");
In this program, hello world is an example of this.
100
What is getWidth() / 2
In a graphics program, I would use this to place the shape in the center of the canvas.
100
What is a variable?
This is used to store information, like a box.
100
True/false
What is a boolean?
100
What is 0?
In this example, it will set (start) the variable at what number?
for(var i = 0; i < 30; i++){
200
What is Camel Case?
var myVarName;
In this example the variable is written in this case.
200
WHat is the radius?
var circle = new Circle(50);
In this example, 50, stands for this.
200
What is &&
These symbols represents the "and" operator in JavaScript?
200
What is ==
This is the correct comparison operator to use when two numerical values are equal.
200
What is 400?
How many times will this code execute?
for(var i = 0; i < 400; i++{
300
What is "readInt"?
If I need a user to input an answer that is a number, I would use this.
300
What is upper left?
To set location of the ____ _____corner of rectangle

we use rect.setPosition(x, y);
300
var numApples = 20;
Write a variable that indicates there are 20 apples.
300
What is an if/else statement?
You could use this in a program that needs to figure out whether one this is true, then it would print one thing, otherwise, it would print something else.
300
for(var i = 0; i < 10; i++){
println(i);
}
Write a forLoop that Prints numbers 0-9 starting at 0 and going up in increment by 1 each time.
400
What is "readBoolean"?
If I had a true/false question for the user, I would use this.
400
What is add one?
In math, any number with a ++ behind it means to do this.
400
function start(){
var dog= readLine("Do you have a dog ?");
var num= readInt("How many dogs ?");

println(dog + num);
}
Write a program that asks a user if they have a dog, and then asks how many dogs they have, then print the line at the end.
400
What is
I would use this to indicate "or" in a JS program.
400
What is 5?
How many times will the following code print "hello"?for (var i = 3; i < 8; i++) { println("hello");}
500
What is !=
This is how you would write this in JavaScript
"not equal"
500
var COST_OF_PIZZA = 10.00;
function start () {
var numPizza = readInt(" How many pizzas do you want ");
var total = (numPizza * COST_OF_PIZZA);
println(total);

}
I need an unknown number of pizzas and each cost 10.00. Write a program to find the total.
500
What is add(circle);
What is missing in this program?

function start(){
2 var circle = new Circle(40);
3 circle.setPosition(getWidth() / 2, getHeight() / 2);
4 circle.setColor(Color.blue);
5 }
500
What is three?
var correctIngredients
var recipe
var canMakeCookies
You need a program that figures whether or not someone has the correct ingredients and has the recipe to make gramma's fave cookies. How many variables would you need to have in this scenario?
500
The variable will start at 1 and multiply that answer by two until it reaches 1 million.
Explain this for loop and how it works
for (var i = 1; i < 1000000; i *= 2){






JavaScript

Press F11 for full screen mode



Limited time offer: Membership 25% off


Clone | Edit | Download / Play Offline