
AP CSA Unit 1 Intro

Quiz
•
Computers
•
12th Grade
•
Easy
Theresa Lewis
Used 2+ times
FREE Resource
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Consider the following code segment.
System.out.print("Java is ");
System.out.println("fun ");
System.out.print("and cool!");
What is printed as a result of executing the code segment?
Java isfun
and cool!
Java is
fun
and cool!
Java is fun
and cool!
2.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Consider the following code segment.
System.out.print("cat ");
System.out.println("dog ");
System.out.println("horse ");
System.out.print("cow ");
What is printed as a result of executing the code segment?
cat dog
horse
cow
cat
dog
horse cow
cat
dog
horse
cow
3.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Consider the following code segment.
System.out.println(hello); // Line 1
System.out.print(world); // Line 2
The code segment is intended to produce the following output but does not work as intended.
hello
world
Which of the following changes can be made so that the code segment produces the intended output?
Inserting System.out.print(); between lines 1 and 2
Inserting System.out.println(); between lines 1 and 2
Changing println in line 1 to print
Changing print in line 2 to println
Enclosing hello in line 1 and world in line 2 in quotation marks
4.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Each of the following code segments is intended to print the word Hello. Which of the following code segments works as intended?
1. System.out.print("Hello");
2. System.out.print(Hello);
3. System.out.print(He);
System.out.print(llo);
1 only
2 only
3 only
1 and 2
2 and 3
5.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Which statement correctly declares a variable that can store a temperature rounded to the nearest tenth of a degree?
boolean patientTemp;
double patientTemp;
int patientTemp;
patientTemp = 0;
patientTemp = 0.0;
6.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
A teacher determines student percentages in a course as the points a student earns divided by the total points available in the grading period. Points are awarded only in whole number increments, but student percentages are to be stored as decimals.
The following code segment appears in a program used to compute student percentages. Points that a student earns are stored in pointsEarned, the total points available in the grading period are stored in totalPoints, and the student percentage is stored in percentage.
int pointsEarned;
/* missing code */
Which of the following is most appropriate to replace /* missing code */ in the program?
int totalPoints;
int percentage;
double totalPoints;
int percentage;
int totalPoints;
double percentage;
int totalPoints;
boolean percentage;
double totalPoints;
boolean percentage;
7.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Consider the following code segment:
/* data type 1 */ x = 0.5;
/* data type 2 */ y = true;
Which of the following best describes the data types that should be used to replace/* data type 1 / and / data type 2 */ so that the code segment compiles without error?
The variable x should be declared as an int and the variable y should be declared as a boolean.
The variable x should be declared as an int and the variable y should be declared as an int.
The variable x should be declared as a double and the variable y should be declared as an int.
The variable x should be declared as a double and the variable y should be declared as a boolean.
The variable x should be declared as a boolean and the variable y should be declared as a boolean.
Create a free account and access millions of resources
Similar Resources on Wayground
20 questions
Conditionals Quiz

Quiz
•
9th - 12th Grade
16 questions
Variables and Data Types Knowledge Check

Quiz
•
9th - 12th Grade
15 questions
2D Arrays

Quiz
•
9th - 12th Grade
18 questions
Unit 5: Conditionals Review

Quiz
•
9th - 12th Grade
15 questions
ASK F2 -KOD ARAHAN (PYTHON)

Quiz
•
1st Grade - University
25 questions
Python - Unit Test 2

Quiz
•
9th Grade - University
15 questions
Basic Python Coding

Quiz
•
11th - 12th Grade
19 questions
Unit 5 - Two-Dimensional Arrays

Quiz
•
9th - 12th Grade
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
20 questions
Digital Citizenship

Quiz
•
8th - 12th Grade
35 questions
Computer Baseline Examination 2025-26

Quiz
•
9th - 12th Grade
13 questions
Problem Solving Process

Quiz
•
9th - 12th Grade
10 questions
Understanding Algorithms with Pseudocode and Flowcharts

Interactive video
•
9th - 12th Grade
19 questions
AP CSP Unit 1 Review (code.org)

Quiz
•
10th - 12th Grade