int variable integer
double variable for fraction
char variable for single character
String variable for text
boolean variable for true of false statement
final int … variable from which the value can’t be changed, variable in capitals
Math.pow(a,b) a to the power of 3
Math.sqrt(a) the square root of a
Math.sin/cos/tan(a) the sine / cosine / tangent of a
Math.PI the number 𝜋
Math.round(a*b) rounds of the answer
Math.log(a) the natural logarithm of a
Math.exp(a) e to the power of a
Math.max/min(a,b) the maximum / minimum value of a and b
Math.abs(a) the absolute value of a
aEb is equal to 𝑎 ∗ 10!
a%b a divided by b, the remainder term is given
a ++ is equal to a = a + 1
int a = (int) b convert variable b from one type to integer
“…” + “…” + X combine variables and text
X.substring(a,b) take a portion of string X, a is the starting index, b the end index (exclusive)
X.substring(a) take a substring of X, starting from index a, to the end
X.length() take the length of a string
X.charAt(a) the character at spot a of X is taken as ascii code
Scanner in = new Scanner(System.in) needed for reading line
in.nextInt() read the integer
in.nextDouble() read the double
in.next() read the string
in.nextLine() read the line
in.hasNextInt() check if the entered value is an integer
X.isEmpty check if the value of X is empty
X.toLowerCase() will get rid of all the capitals in the string X
\u20AC euro sign, placed inside “ “
\n an enter, placed inside “ “
(“%5.2f”, X) will place the floating number X after 5 spaces and rounded off to 2 decimals,
placed after System.out.printf
(“%5d/s”, X) will place the integer / string X after 5 spaces
Integer.parseInt(X) will change the string number X to an interger
X == Y check if X and Y are the same (will be true or false)
X>/<Y check if X is larger / smaller than Y (will be true or false)
X >= / <= Y check if X is equal or larger / smaller than Y (will be true or false)
X != Y check if X is not equal to Y (will be true or false)
X.equals(“…”) check if the string X contains the text “…” (will be true or false)
A && B check if A and B are true (will be true or false)
A || B check if A or B is true or both true (will be true or false)
!A will change A from to true to false if A was true, or the other way around
int/String/double[] A; create an array called A containing integers / strings / doubles
int[] A = new int[a]; create an array called A containing ‘a’ integers
int[] A = {a, …}; create an array called A with the elements ‘a, …’
double variable for fraction
char variable for single character
String variable for text
boolean variable for true of false statement
final int … variable from which the value can’t be changed, variable in capitals
Math.pow(a,b) a to the power of 3
Math.sqrt(a) the square root of a
Math.sin/cos/tan(a) the sine / cosine / tangent of a
Math.PI the number 𝜋
Math.round(a*b) rounds of the answer
Math.log(a) the natural logarithm of a
Math.exp(a) e to the power of a
Math.max/min(a,b) the maximum / minimum value of a and b
Math.abs(a) the absolute value of a
aEb is equal to 𝑎 ∗ 10!
a%b a divided by b, the remainder term is given
a ++ is equal to a = a + 1
int a = (int) b convert variable b from one type to integer
“…” + “…” + X combine variables and text
X.substring(a,b) take a portion of string X, a is the starting index, b the end index (exclusive)
X.substring(a) take a substring of X, starting from index a, to the end
X.length() take the length of a string
X.charAt(a) the character at spot a of X is taken as ascii code
Scanner in = new Scanner(System.in) needed for reading line
in.nextInt() read the integer
in.nextDouble() read the double
in.next() read the string
in.nextLine() read the line
in.hasNextInt() check if the entered value is an integer
X.isEmpty check if the value of X is empty
X.toLowerCase() will get rid of all the capitals in the string X
\u20AC euro sign, placed inside “ “
\n an enter, placed inside “ “
(“%5.2f”, X) will place the floating number X after 5 spaces and rounded off to 2 decimals,
placed after System.out.printf
(“%5d/s”, X) will place the integer / string X after 5 spaces
Integer.parseInt(X) will change the string number X to an interger
X == Y check if X and Y are the same (will be true or false)
X>/<Y check if X is larger / smaller than Y (will be true or false)
X >= / <= Y check if X is equal or larger / smaller than Y (will be true or false)
X != Y check if X is not equal to Y (will be true or false)
X.equals(“…”) check if the string X contains the text “…” (will be true or false)
A && B check if A and B are true (will be true or false)
A || B check if A or B is true or both true (will be true or false)
!A will change A from to true to false if A was true, or the other way around
int/String/double[] A; create an array called A containing integers / strings / doubles
int[] A = new int[a]; create an array called A containing ‘a’ integers
int[] A = {a, …}; create an array called A with the elements ‘a, …’