What are the values of the variables x, y, and z after the following is executed:
CS A U1 Review

Quiz
•
Computers
•
12th Grade
•
Hard
Michael Pogue
FREE Resource
8 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
x = 6, y = 6, z = 6
x = 4, y = 4, z = 4
x = 4, y = 6, z = 6
x = 5, y = 4, z = 4
x = 4, y = 6, z = 5
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
The following code segment is intended to output 0.5. What, if any, is the error in the code?
There is a syntax error: you cannot make an arithmetic expression that contains variables of different data types.
There is a syntax error: you must pass a String as a parameter to System.out.println().
There is a syntax error: you cannot assign an int value to a double variable without casting.
There is a logic error: lossy conversion of int to double.
This code works as intended.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following will result in a value of type double?
I only
II only
I and II only
I, II and III
None
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following would be output by this code segment?
7 , 1
7.0
7.0
1
7.0 , 1
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following would be output by this code segment? int max = 2147483647; max++; System.out.println(max);
2147483648
0
syntax error
-2147483648
none of the above
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the following code segment. What is printed as a result of executing the code segment? int num = 5 / 3; System.out.print(num); System.out.print(" "); System.out.print((double) num);
1.0 , 1
2.0 , 2
1 , 1.0
1.67 , 1
1.67 , 1.0
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following expressions evaluate to -1.0? I. (double) 5 / 3 - 2 II. (double) (5 / 3) - 2 III. (double) (5 / 3 - 2)
I only
I and II only
II and III only
I, II, and III
None evaluate to -1.0
8.
MULTIPLE SELECT QUESTION
30 sec • 1 pt
What will print out from the following code segment?
5
8
5
7
3
Similar Resources on Quizizz
8 questions
AP CSP Unit 3 Simple Review

Quiz
•
9th - 12th Grade
10 questions
Java Code Tracing Practice A

Quiz
•
9th - 12th Grade
10 questions
Python Basics

Quiz
•
12th Grade - University
10 questions
Java Coding

Quiz
•
9th - 12th Grade
10 questions
AP CSA Unit 1 & 2 Review

Quiz
•
9th - 12th Grade
10 questions
Variables in C++

Quiz
•
9th - 12th Grade
9 questions
Java Basics #1

Quiz
•
10th - 12th Grade
10 questions
Unit 6

Quiz
•
12th Grade
Popular Resources on Quizizz
15 questions
Character Analysis

Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
10 questions
American Flag

Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25

Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade
Discover more resources for Computers
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
20 questions
Taxes

Quiz
•
9th - 12th Grade
17 questions
Parts of Speech

Quiz
•
7th - 12th Grade
20 questions
Chapter 3 - Making a Good Impression

Quiz
•
9th - 12th Grade
20 questions
Inequalities Graphing

Quiz
•
9th - 12th Grade
10 questions
Identifying equations

Quiz
•
KG - University