A name associated with a memory location in the computer where a value is stored
What is a variable?
An example of how you increment the variable count by 1.
What is
count = count +1 ?Technique used to simulate a dry run through the code line by line.
What is code tracing?
Convert variable values to a different type.
What is type casting?
What is Ms. Lydon
The word that is added in front of a declared variable type if its value cannot be changed once it is initialized
What is final used for?
The modulo operator is used to find the...
What is the % symbol used for remainder
What is x-=1 or x = x-1
2 ways to get a double result when doing division in Java
Use at least one double in the operation
cast one of the int using (double)
Your teacher's new name after November
The 3 primitive types of variables that are tested on the CSA exam.
What are:
int (integers)double (decimal)
boolean (true/false)
To test if 2 items are equal.
What is ==
Shortcut that do a math operation & assignment in one step.
What is a compound assignment operator?
attempting to store a number >Max or <Min
What is integer overflow?
1) Methods & Control Structures
2) Classes
3) Arrays/ArrayList
4) 2D Arrays
4 FRQ Topics
Symbol that sets the value in the memory location of the variable on the left to copy the value on the right.
What is an = sign?
Used to initialize or change the value stored in a variable (use =, read as "gets the value of")
What is an assignment statement?
int x = 0;
int y = 5;
int z = 1;
x++;
y -= 3;
z = x + z;
x = y * z;
y %= 2;
z--;
System.out.println(“x = “ + x);
System.out.println(“y = “ + y);
System.out.println(“z = “ + z);
What is x=4, y=0, z=1
public class OperatorTest2{
public static void main(String[] args){
System.out.println(1/4);
System.out.println(1.0/4);
System.out.println(1/4.0);
System.out.println((double)1/4);
System.out.println((int)1.0/4);
}
}
0, 0.25
0.25
0.25
0
Amount of questions on the exam.
40
Rules for naming variables in Java. (List 3)
Start with an alphabetical character (lower case)
all one word (no spaces)
can use letters, numbers, & ____
can't use reserved words
name should describe the data variable
don't put inside ""
case and letter sensitive
camelCase
Error message for attempting to divide by 0.
What is the ArithmeticException?
int a = 7;
int b = 2;
int c = a - b;
a = a - 6;
b++;
c = c--;
System.out.println(“a = “ + a);
System.out.println(“b = “ + b);
System.out.println(“c = “ + c);
What is a=1, b=3, c=4
Code needed to round
a double value to the nearest
positive integer?
all Java programs
start with.
public class MyProgram {
}