What is a variable in programming?
AP CSA Primitive Types Practice

Quiz
•
Computers
•
11th Grade
•
Medium
David Lakind
Used 45+ times
FREE Resource
22 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
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 Quizizz
21 questions
SAINS KOMPUTER TINGKATAN 4 (BAB1)

Quiz
•
KG - University
18 questions
GCSE Computer Science Data types

Quiz
•
10th - 12th Grade
20 questions
PEMBOLEHUBAH,PEMALAR DAN JENIS DATA

Quiz
•
7th - 12th Grade
21 questions
Sains Komputer Ting 4

Quiz
•
10th - 11th Grade
20 questions
Evaluación intermedia once

Quiz
•
1st - 11th Grade
22 questions
BAB 3 : KOD ARAHAN

Quiz
•
7th - 12th Grade
20 questions
quiz dasar python

Quiz
•
1st Grade - University
20 questions
Java Casting & Booleans

Quiz
•
10th - 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
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
30 questions
Linear Inequalities

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