AP CSA Primitive Types Practice

Quiz
•
Computers
•
11th Grade
•
Medium
David Lakind
Used 61+ times
FREE Resource
22 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is a variable in programming?
A variable is a named storage location that holds a value.
A variable is a function in programming.
A variable is a type of loop in programming.
A variable is a mathematical equation.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following options are primitive data types in Java?
integer, boolean, double, String
integer, boolean, double
integer, boolean, double, String, Scanner
integer, boolean, double, String, Object
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the syntax for declaring a variable in Java?
var myVar;
myVariable = int;
int myVariable;
declare myVariable;
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the difference between int and double data types?
int is used for storing characters while double is used for storing strings.
int is used for whole numbers while double is used for decimal numbers.
int is used for decimal numbers while double is used for whole numbers.
int is used for positive numbers while double is used for negative numbers.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of a variable?
To store and manipulate data in a program.
To execute functions in a program.
To display data in a program.
To control the flow of a program.
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
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?
WXYZ
W
XYZ
WX
YZ
W
X
YZ
W
X
Y
Z
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
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;
I. only
II. only
III. only
I. and II.
II. and III.
Create a free account and access millions of resources
Similar Resources on Wayground
20 questions
QUIZ DASAR DASAR PEMROGRAMAN JAVA

Quiz
•
11th Grade - University
20 questions
Quarter 3 Final Exam: Functions and Parameters

Quiz
•
9th - 12th Grade
25 questions
Java CodeHS 1.1-1.3

Quiz
•
9th - 12th Grade
22 questions
edhesive Unit 1 Vocabulary

Quiz
•
9th - 12th Grade
20 questions
Mod 2 Test

Quiz
•
9th - 12th Grade
20 questions
Variables and Loops Review

Quiz
•
9th - 12th Grade
20 questions
Computer 10 | Introduction to Java

Quiz
•
9th - 12th Grade
24 questions
AGAD: UNIT 4_C# & UNITY

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