When was Java released?
1995
How would you set a new boolean variable called codingIsFun to true?
boolean codingIsFun = true;
int zombies = 5;
sets the number of zombies to 5
boolean bugs = 10;
wrong data type (should be integer)
Where are the horses?
In the back
What company now owns Java?
Oracle
How would you print a line that says "Ruby is a very cool teacher" to the console?
System.out.println("Ruby is a very cool teacher");
System.out.println("Hello World!");
prints "Hello World!" to the console
int cats = 5.25;
wrong variable type (should be double)
Name three variable types
Possible answers: int(eger), double, String, float, boolean
What version of Minecraft do we usually run at this camp?
Java!
What is the correct format for an "if" statement?
if (condition) {
//then do this;
}
#000000
Black
wrong capitalization (should be String)
Why are unicorns so big? (question by Charlotte)
Because they could have a baby
What is Ruby's go-to coffee (Java) order?
Tea.
How do you write a "for" loop that iterates through an array and adds 1 to each element in the array?
for (var i = 0; i<arr.length; i++){
arr[i]++;
}
#00FF00
Lime green
if (bugs>0){
System.out.println("Ew! I hate bugs!");
else {
System.out.println("So glad there are no bugs here!");
}
Missing curly bracket
What's in the picture in the tree?
A woman and a cow
What does OOP stand for?
Object-oriented programming!
How would you write a method that returns an integer that is 5 greater than the integer you put into it?
public void add5(int num){
return num+=5;
}
int[] spotsOnLadyBugs = new int[4];
for (var i=0; i<spotsOnLadyBugs.length; i++){
spotsOnLadyBugs[i]=(i-2)*3
System.out.println(spotsOnLadyBugs[i] + " spots!");
}
prints
-6 spots!
-3 spots!
0 spots!
3 spots!
if (bugs>0) {
if (bugSpray){
System.out.println("Spray the bugs!");
}
if (everything =="okay")
System.out.println("Everything is okay.");
}
}
Missing curly bracket
Why do unicorns have a horn? (This question proposed by Eva/Eva/Gabby/Gabriela)
Because they have a horn at the end of their name