Variables
Math
Scanners
Operators
Print Statements
100

Name three different primitive variable types

Any 3 of the following: int, double, char, boolean, float, long, short, byte

100

What will be the output of the following code: System.out.println((40 + 24)/4);

a. 4

b. 16

c. 20

d. Syntax Error

b. 16

100

What is the proper way to create a scanner object

a. Scanner scn New Scanner(System.in);

b. New Scanner;

c. Scanner scn = New Scanner(System.in);

d. Scanner scn = New Scanner();

c. Scanner scn = New Scanner(System.in);

100

What do these Operators do

+= 

-=

*=

/=

preform the chosen operation on a variable 

100

What is the name for adding two strings together

String Concatenation 

200

True or False:

This statement will cause a syntax error

double myDouble = 202;

False
200

What will be the output of the following code:

System.out.println( 10 + 30 / 5);

16

200

What is the full statement to import only the scanner class

java.util.Scanner

200

What is the operator to get the remainder of a division operation

The Modulus operator %

200

What is wrong with this statement?

System.out.println("Welcome to " + "my Java Program!)";

the second parenthesis is inside the string.

300

What is Wrong with this code:

num1 = 30;

System.out.println(num1);

No variable identifier 

300

What will be the Output of the following Code    

 int num1 = 303%10;      System.out.println(num1/10);

0

300

What is the parameter needed to tell the scanner it will be reading input from the keyboard

300

What is the keyword for adding an outside package or class to your program

import

300

What is the output from the following print statement

System.out.println("Welcome to" + "the exam review");

Welcome tothe exam review

400

Given the statement

int myInt = 50;

How would you create a new variable that is equal to myInt but is a double variable?

double myDouble = (double) myInt

400

What is one method of rounding a double to two decimal places. (Hint, there is multiple methods)

type cast to int and then divide by 100,

use the Math.round function and then divide by 100

And others

400

What is the prompt needed to tell a scanner to read the next String?

nextLine

400

True or false:

you need a semicolon at the end of an import statement?

true

400

How do you write a print statement that you want to stay on the same line after printing

System.out.print();

500

What is the difference between Declaration and Initialization?

Declaration is creating a variable and giving it a name whereas Initialization actually assigns that variable a value.

500

What will be the output of the Following code: 

Int number = 250

if(number > 200){

System.out.println(number * 3 / 25)

}

else{

System.out.println(303%30);
}


Output would be 30. Did anyone catch the syntax error?
500

True or False:

This code will work

scanner scn = new scanner(System.in);

false because scanner is not capitalized 

500

What does the following code print

      int num1 = 202;

      int num2 = 35; 

      num2 += num1;     

      System.out.println(num1);

202

500

What is the syntax to print the value of the variable num1?

a. System.out.println("num1");

b. System.out.println(num1);

c. System.out.println(Num1);

d. System.out.println("num1)";

b. System.out.println(num1);