
AP Computer Science A Quiz
Passage
•
Computers
•
12th Grade
•
Practice Problem
•
Hard
Xin Deng
Used 2+ times
FREE Resource
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
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");
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
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
13 questions
Researchers Discover New Circuit Element
Passage
•
KG - University
16 questions
Unit 308 session 1a (Underpinning knowledge)
Passage
•
KG - University
6 questions
Uniform and Appearance Standards in Fire Brigades
Passage
•
12th Grade
6 questions
Sistem-Starter-Konvensional-Analisis-Komponen-dan-Diagnosa
Passage
•
11th Grade
16 questions
Unit A1 Quiz
Passage
•
12th Grade
11 questions
Stress and Growth Mindset Quiz
Passage
•
12th Grade
11 questions
Labor Union Quiz
Passage
•
12th Grade
11 questions
Reading Comprehension: Ken Robinson Divergent Thinking
Passage
•
KG - University
Popular Resources on Wayground
5 questions
This is not a...winter edition (Drawing game)
Quiz
•
1st - 5th Grade
15 questions
4:3 Model Multiplication of Decimals by Whole Numbers
Quiz
•
5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
The Best Christmas Pageant Ever Chapters 1 & 2
Quiz
•
4th Grade
12 questions
Unit 4 Review Day
Quiz
•
3rd Grade
10 questions
Identify Iconic Christmas Movie Scenes
Interactive video
•
6th - 10th Grade
20 questions
Christmas Trivia
Quiz
•
6th - 8th Grade
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
Discover more resources for Computers
15 questions
Internet Vocabulary Notebook Check #2 - CTEA(2024)
Quiz
•
12th Grade
11 questions
Internet Terms Vocabulary- Notebook Check #1- CTEA
Quiz
•
12th Grade
50 questions
Money Matters Fall 2025 Final Exam — Worksheet Questions
Quiz
•
12th Grade
47 questions
CSF Final Exam Practice
Quiz
•
9th - 12th Grade