Show:
Questions
Responses
Print
Input/Output
Operators
Class Math
Class String
IF Statements
100
What is the difference between input and output?
Input is information that the user gives the computer. Output is what the computer gives back to the user.
100
Draw the operator for "less than"
<
100
max(14,45)
45
100
What is a String?
Class used to characterize and manipulate character arrays such as words
100
What are IF statements used for?
To make decisions; add branching structure; answer questions
200
Name two different ways to generate output.
System.out.print(); System.out.println(); System.out.printf(); JOptionPane.showMessageDialog()
200
Draw the operator for "not equal to"
!=
200
round(32.444449)
32
200
When indexing String characters, what number should you begin counting with?
0
200
Write the structure for a standard IF statement
if (condition) {
//statements
}
300
What is the name of the class associated with input?
Scanner
300
Does the following conditional statement evaluate to TRUE, FALSE, or NEITHER?
int x=5; int y=13;
x >= y
FALSE
300
pow(4,2)
16
300
String str = "I love Jeopardy!";
str.charAt(7) = ?
J
300
When do you need to use ELSE IF statements?
When the question your IF statement is answering has 3 or more possible outcomes.
400
What is the package that must be imported in order to generate input?
java.util.*
400
Does the following conditional statement evaluate to TRUE, FALSE, or NEITHER?
int x=5; int y=13;
x = y
NEITHER
400
sqrt(max(pow(2,3),pow(3,2)));
3
400
String str = "I love Jeopardy!";
str.indexOf('A') = ?
-1
400
What is the maximum number of IFs, ELSE-IFs, and ELSE's per IF statement?
IFs: 1; ELSE-IFs: infinite; ELSEs: 1
500
What is the difference between console.next() and console.nextLine() ?
console.next is used for single-word Strings (no spaces) whereas console.nextline() should be used for Strings that include spaces.
500
Draw the symbol for the "concatenate" operator, AND describe what it is used for.
+, joining two Strings together
Example: System.out.println("Hello" + " there " + name);
500
What is the code that would be necessary to complete the following math problem:
log (45.6) = ?
log10(45.6)
500
String str = "I love Jeopardy!";
str.substring(2,7) = ?
"love "
500
Why is there not a condition after an ELSE statement?
Because ELSE is EVERYTHING else. It should not be limited by another condition. It's what the computer should do if no other case is true.