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?

Unit 1: Primitive Types - Test Review

Quiz
•
Mathematics
•
9th Grade
•
Hard
Karen Shih
Used 2+ times
FREE Resource
20 questions
Show all answers
1.
MULTIPLE SELECT QUESTION
30 sec • 1 pt
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
Create a free account and access millions of resources
Similar Resources on Quizizz
15 questions
Graphing/Solving for Y

Quiz
•
8th - 10th Grade
15 questions
Slope Intercept Form

Quiz
•
8th - 9th Grade
20 questions
Standard Form and Intercepts

Quiz
•
8th - 11th Grade
19 questions
Graphs Using X and Y Intercepts Linear Equations

Quiz
•
8th Grade - University
20 questions
Algebra Mid-Year

Quiz
•
8th Grade - University
16 questions
De todo

Quiz
•
1st Grade - Professio...
18 questions
Graphing Linear Equations by Making a Table

Quiz
•
8th Grade - University
20 questions
Slope, Intercepts, and Graphing Equations

Quiz
•
9th - 12th Grade
Popular Resources on Quizizz
15 questions
Multiplication Facts

Quiz
•
4th Grade
25 questions
SS Combined Advisory Quiz

Quiz
•
6th - 8th Grade
40 questions
Week 4 Student In Class Practice Set

Quiz
•
9th - 12th Grade
40 questions
SOL: ILE DNA Tech, Gen, Evol 2025

Quiz
•
9th - 12th Grade
20 questions
NC Universities (R2H)

Quiz
•
9th - 12th Grade
15 questions
June Review Quiz

Quiz
•
Professional Development
20 questions
Congruent and Similar Triangles

Quiz
•
8th Grade
25 questions
Triangle Inequalities

Quiz
•
10th - 12th Grade
Discover more resources for Mathematics
40 questions
Week 4 Student In Class Practice Set

Quiz
•
9th - 12th Grade
10 questions
Exponential Growth and Decay Word Problems

Quiz
•
9th Grade
45 questions
Week 3.5 Review: Set 1

Quiz
•
9th - 12th Grade
17 questions
High School Survival Guide

Lesson
•
9th - 12th Grade
15 questions
Factoring Quadratics

Quiz
•
9th Grade