Consider the following code segment.
System.out.println("W");
System.out.println("X");
System.out.print("Y");
System.out.print("Z");
What is printed as a result of executing the code segment?
Options: WXYZ, WXYZ, WX, YZ, W, X, YZ, W, X, Y, Z
AP CS A Unit 1 Review

Flashcard
•
Computers
•
9th - 12th Grade
•
Hard
Quizizz Content
FREE Resource
Student preview

37 questions
Show all answers
1.
FLASHCARD QUESTION
Front
Back
W
X
YZ
2.
FLASHCARD QUESTION
Front
Consider the following code segment:
int x = 10;
int y = 20;
/* missing code */
System.out.print(top / bottom);
Which of the following replacements for /* missing code */ 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;
Options: I. only, II. only, III. only, I. and II., II. and III.
Back
II. only
3.
FLASHCARD QUESTION
Front
Consider the following code segment, which is intended to display 6.0.
double fact1 = 1 / 2;
double fact2 = 3 * 4;
double product = fact1 * fact2;
System.out.println(product);
Which of the following best describes the error, if any, in the code segment? Options:
There are no errors and the code works as intended.
Either the numerator or the denominator of the fraction 1 / 2 should be cast as double.
The expression fact1 * fact2 should be cast as double.
The expressions 1 / 2 and 3 * 4 should both be cast as double.
The variables fact1 and fact2 should both be declared as int.
Back
Either the numerator or the denominator of the fraction 1 / 2 should be cast as double.
4.
FLASHCARD QUESTION
Front
Is the following identifier legal or illegal? MyFirstProgram
Back
legal
5.
FLASHCARD QUESTION
Front
Is the following identifier legal or illegal: Hello+there?
Back
illegal
6.
FLASHCARD QUESTION
Front
Is the following identifier legal or illegal: void
Back
illegal
7.
FLASHCARD QUESTION
Front
Is the following identifier legal or illegal? This-is-fun
Back
illegal
Create a free account and access millions of resources
Similar Resources on Quizizz
35 questions
Project-Stem Python Final Exam

Flashcard
•
9th - 12th Grade
36 questions
AP CS A Midterm Review

Flashcard
•
9th - 12th Grade
30 questions
Java Loop Execution Flashcard disney

Flashcard
•
9th Grade - University
25 questions
Python Data Types

Flashcard
•
9th - 12th Grade
29 questions
AP CSA Unit 3 Boolean Expressions

Flashcard
•
10th - 12th Grade
26 questions
Code.org: Unit 2 Lesson 1-13 Flashcard

Flashcard
•
9th - 12th Grade
29 questions
Unit 3: Intro to App Design (APCSP 22-23, Code.org)

Flashcard
•
9th - 12th Grade
28 questions
Quarter 4 Practice 1

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

Quiz
•
4th Grade
20 questions
Math Review - Grade 6

Quiz
•
6th Grade
20 questions
math review

Quiz
•
4th Grade
5 questions
capitalization in sentences

Quiz
•
5th - 8th Grade
10 questions
Juneteenth History and Significance

Interactive video
•
5th - 8th Grade
15 questions
Adding and Subtracting Fractions

Quiz
•
5th Grade
10 questions
R2H Day One Internship Expectation Review Guidelines

Quiz
•
Professional Development
12 questions
Dividing Fractions

Quiz
•
6th Grade
Discover more resources for Computers
25 questions
Spanish preterite verbs (irregular/changed)

Quiz
•
9th - 10th Grade
10 questions
Identify Slope and y-intercept (from equation)

Quiz
•
8th - 9th Grade
10 questions
Juneteenth: History and Significance

Interactive video
•
7th - 12th Grade
8 questions
"Keeping the City of Venice Afloat" - STAAR Bootcamp, Day 1

Quiz
•
9th - 12th Grade
26 questions
June 19th

Quiz
•
4th - 9th Grade
20 questions
Distance, Midpoint, and Slope

Quiz
•
10th Grade
20 questions
Figurative Language Review

Quiz
•
10th Grade
27 questions
STAAR English 1 Review

Quiz
•
9th Grade