What is printed as a result of executing the following code segment? System.out.println("W"); System.out.println("X"); System.out.print("Y"); System.out.print("Z");

AP Computer Science A Quiz

Passage
•
Computers
•
12th Grade
•
Hard
Xin Deng
Used 2+ times
FREE Resource
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
W X YZ
W XYZ
WX YZ
WXYZ
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is printed as a result of executing the following code segment? System.out.print("cat "); System.out.println("dog "); System.out.println("horse "); System.out.print("cow ");
cat dog horse cow
cat dog horse cow
cat dog horse cow
cat dog horse cow
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is printed as a result of executing the following code segment? System.out.print("Hello!"); System.out.println("How "); System.out.print("are "); System.out.print("you?");
Hello! How are you?
Hello!How are you?
Hello!How are you?
Hello!Howareyou?
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following changes can be made so that the following code segment produces the intended output? System.out.println(hello); // Line 1 System.out.print(world); // Line 2 hello world
Changing println in line 1 to print
Inserting System.out.println(); between lines 1 and 2
Enclosing hello in line 1 and world in line 2 in quotation marks
Inserting System.out.print(); between lines 1 and 2
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which change can be made so that the following code segment produces the intended output? System.out.print("Ready"); // Line 1 System.out.print("Set"); // Line 2 System.out.print("Go!"); // Line 3 Ready Set Go!
Interchanging lines 1 and 3
Changing print to println in lines 1 and 2
Changing print to println in line 3
No change is needed; the code segment works correctly as is.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following code segments works as intended to print the word Hello? I. System.out.print("Hello"); II. System.out.print(Hello); III. System.out.print(He); System.out.print(llo);
I and II
II only
I and III
I only
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which statement correctly declares a variable that can store a temperature rounded to the nearest tenth of a degree?
patientTemp = 0;
int patientTemp;
double patientTemp;
boolean patientTemp;
Create a free account and access millions of resources
Similar Resources on Quizizz
10 questions
Software (Interactive Lesson)

Passage
•
12th Grade
13 questions
Optimizing Networks Post Lab Quiz

Passage
•
11th Grade
6 questions
KUIS PRAKTIK

Passage
•
11th Grade
9 questions
Understanding Snowflake Data Types

Passage
•
11th Grade
8 questions
AP CS A REFERENCE SHEET

Passage
•
12th Grade
6 questions
Understanding High-Level and Low-Level Programming Languages

Passage
•
11th Grade
11 questions
Star and Delta Configurations

Passage
•
12th Grade
11 questions
T- levels BSE: Unit 8 lesson 3 knowledge checker

Passage
•
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