This person co-founded Microsoft
Who is Bill Gates?
public class Main {
public static void main(String[] args) {
System.out.println("Hello, world") }
}
This thing is missing from the code.
What is a semicolon?
System.out.println(10 / 4);
This is the output of the code.
What is 2?
This is used to store information or a value and can be named in a program
What is a variable?
This person founded Apple
Who is Steve Jobs?
This is missing from the code.
x = 10;
System.out.println(x);
What is int?
This is the output of the code.
What is 9106?
This type of loop continues running as long as its condition remains true
What is a while loop?
This person is considered the first computer programmer and is a woman
Who is Ada Lovelace?
This is what the code is missing.
public int addNumbers(int a, int b) {
System.out.print(a + b);
}
What is a return statement?
int[] arr = {6, 2, 3, 10, 5};
int sum = 0;
for (int i = 0; i < arr.length; i++) {
if (arr[i] % 2 == 0) {
sum += arr[i]; }
}
System.out.println(sum);
What is 18?
This is a data structure that cannot have elements added or deleted from it in Java (and can be accessed with indexes)
What is an array?
This person is the father of AI (and hint hint had the CS honors college at UT Austin named after him)
Who is Alan Turing?
public static void main(String[] args) {
int x = 0;
while (x < 5) {
System.out.println("Bob");
x -= 1; }
}
This issue causes the code to keep running.
What is an infinite loop?
This is the output of the code.
int num = 11; System.out.println(Integer.toBinaryString(num));
(hint hint this turns into a 4 bit binary sequence)
What is 1011?
This is a function that allows a function to call itself within its own definition
What is recursion?
This person is from Brazil and graduated from the University of Paraiba
Who is Mrs. Soares?
String text = null;
System.out.println(text.length());
This is the name of the error.
What is a NullPointerException?
This is the output of the code below.
public static void main(String[] args) {
System.out.println(countdown(3));
}
public static String countdown(int n) {
if (n == 0) {
return "Done!";
} else {
return n + " " + countdown(n - 1);
}
}
What is "3 2 1 Done!"?
The first method that runs in a class before any other method (allows for the initialization and declaration of variables)
What is a constructor?