
Unit 1: Primitive Types - Test Review
Quiz
•
Mathematics
•
9th Grade
•
Practice Problem
•
Hard
Karen Shih
Used 2+ times
FREE Resource
Enhance your content in a minute
20 questions
Show all answers
1.
MULTIPLE SELECT QUESTION
30 sec • 1 pt
Consider the following code segment. System.out.print("turtle "); System.out.println("snake "); System.out.println("dog "); System.out.print("cat "); What is printed as a result of executing the code segment?
turtle
snake
dog
cat
turtle snake
dog
cat
turtle snake
dog cat
turtle snake
dog cat
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the following code segment.
int x = 10;
int y = 20;
/* missing code */
System.out..print(top / bottom);
Which of the following can be used as a replacement for /* missing expression */ will cause an ArithmeticException to occur?
I. int top = x - y;
int bottom = y - x;
II. int top = 2 * x;
int bottom = y - top;
III. int top = x + y;
int bottom = 2 * top;
I only
II only
III only
I and II only
II and III only
3.
MULTIPLE SELECT QUESTION
30 sec • 1 pt
Which of the following expressions will evaluate to 1?
I. 2 / 5 % 3
II. 2 / (5 % 3)
III. 2 / 5 + 1
I only
II only
III only
I and II only
II and III only
4.
MULTIPLE SELECT QUESTION
30 sec • 1 pt
Consider the following code segment:
int a = 10;
double b = 10.7;
double c = a + b;
int d = a + c;
System.out.println(c+" "+d);
20 20
20.0 30
20.7 31
20.7 30.7
Nothing will be printed because of an error
5.
MULTIPLE SELECT QUESTION
30 sec • 1 pt
Which of the following statements will not result in a compiler error?
I. int x = (double) 4.5;
II. int x = (int) 4.5;
III. int x = 4.5;
I only
II only
III only
I and II only
I, II, and III are all legal expressions
6.
MULTIPLE SELECT QUESTION
30 sec • 1 pt
What is the output of the following code? int a = 1, b = 2, c = 3; a += b + c; b += a + c; c += a + b; System.out.println(a + " " + b + " " + c);
3 3 4
3 5 6
5 4 3
5 8 13
6 11 20
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What output is produced by the following line of code? int myNumber = 4; System.out.println("myNumber/3 = 1"); System.out.println(myNumber/3);
Compiler Error
1.333333333333 = 1 1.333333333333
1 = 1 1
myNumber/3 = 1 1.333333333333
myNumber/3 = 1 1
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
19 questions
Intervalos
Quiz
•
1st - 10th Grade
20 questions
Linear Equations: Graphing from Standard Form and Slope Inte
Quiz
•
8th - 9th Grade
17 questions
Equações
Quiz
•
9th Grade
20 questions
Sky will rain
Quiz
•
9th Grade
20 questions
quiz 3
Quiz
•
7th Grade - University
15 questions
Multiplying powers
Quiz
•
8th - 11th Grade
20 questions
Funkcje
Quiz
•
9th - 10th Grade
20 questions
Unit 8 Review
Quiz
•
9th Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
54 questions
Analyzing Line Graphs & Tables
Quiz
•
4th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
Discover more resources for Mathematics
20 questions
Graphing Inequalities on a Number Line
Quiz
•
6th - 9th Grade
18 questions
SAT Prep: Ratios, Proportions, & Percents
Quiz
•
9th - 10th Grade
12 questions
Exponential Growth and Decay
Quiz
•
9th Grade
12 questions
Add and Subtract Polynomials
Quiz
•
9th - 12th Grade
15 questions
Combine Like Terms and Distributive Property
Quiz
•
8th - 9th Grade
20 questions
Function or Not a Function
Quiz
•
8th - 9th Grade
10 questions
Elijah McCoy: Innovations and Impact in Black History
Interactive video
•
6th - 10th Grade
16 questions
Converting Improper Fractions to Mixed Numbers
Quiz
•
4th - 10th Grade
