What is it called when you change one data type into another between int and double?
Casting
What does ++ do the value of a variable?
Adds +1
What is the data type of 0?
int
In Java, this operation happens first in the order of operations.
Parentheses
What does the Scanner class let you do?
Allows user input
What does module refer to?
The remainder of two numbers after division
What is wrong with the variable name 3score?
Variables cannot begin with a number.
What is the value of (int)5.9?
5
What is the result if int x = 5; x += 3;
8
What data type would best store a person’s GPA?
double
What is the value of 2 + 3 * 4?
14
What is the value of 10 % 4?
2
What does it mean to initialize a variable?
You assign it a value
If int x = 3; double y = 2.0; what is the result of x / y?
1.5
Rewrite count = count - 1; using a compound operator.
count -=1
This data type is used to store true or false values.
boolean
What is the value of 2 + 12 / 3 * 2?
10
What method of Scanner reads an integer value?
scan.nextInt();
What is the value of 3 % 9?
3
Declare a variable called age and initialize it to 17.5 in one line.
double age = 17.5;
What is the result of (double)(7/2)?
3.0
What is the final value of z given the following code?
int z = 6;
z += 4;
z *= 2;
z -= 5;
15
What data type is the output of:
System.out.println(3 + 4.0);?
double
What is the value of 7 / 2 * 2?
6
Write the code to read a user’s name as a String. Include the print statement.
System.out.println("What is your name? ");
String name = scan.nextLine();
What is the value of 4 % 5 % 0?
run time error
What is the default value of a double variable?
0.0
What is the output of the following code?
int a = 5;
int b = 2;
double c = (double) a / b;
System.out.println(c);
2.5
What is the final value of x if
int x = 10;
x *= 2;
x /= 5;
x--;
3
What is the data type of the output of the following code:
String s1 = "AP";
String s2 = "CSA";
String s3 = s1 + 1 + 2 + s2;
System.out.println(s3);
String
What is the output of the following code?
double result = 10 - 3 * 2 + 8 / 4.0;
System.out.println(result);
6.0
What do you need to include after using a scanner to input int or double?
scan.nextLine();
What is the value of 15.0 % 3.0?
0.0
What do you include when declaring a variable?
data type & name