Unit 1: Primitive Types - AP Computer Science A
Quiz
•
Computers
•
9th - 12th Grade
•
Hard
Arasaka Teacher
FREE Resource
Enhance your content in a minute
33 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
If your code has a syntax error, what kind of error will you see on the console?
compile-time error
ArithmeticException
logic error
NullPointerException
IndexOutOfBoundsException
2.
DRAG AND DROP QUESTION
3 mins • 1 pt
(a) means to tell the computer that you want to use a variable and give it a name.
(b) means to give that variable its first value.
3.
FILL IN THE BLANK QUESTION
45 sec • 1 pt
The word c_____e means to change source code (like Java) into machine code or bytecode (e.g. 0s and 1s).
4.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
You need to create a variable for the number of cars owned. Which variable initialization is best?
int carsOwned;
double carsOwned;
int num_cars;
double numberOfCarsOwned;
int numberOfCarsOwned;
Answer explanation
You can't have half a car or 0.5 cars, so we should create an "int" variable.
Good variable names are easy to understand, short, and written in camelCase.
5.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
You need to create a variable for the number of computers in the school lab. Which variable initialization is best?
int computersInLab;
double computersInLab;
int num_computers_in_lab;
double numberOfComputersInLab;
int numberOfComputersInLab;
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Why is it important to choose good variable names when creating variables in Java?
Good variable names improve code readability and maintainability, making it easier to cooperate with others..
7.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
You need to create a variable for the price of a sandwich. Which variable initialization is best?
int sandwichPrice;
double sandwichPrice;
int sandwich_price;
double priceOfASandwich;
int priceOfASandwich;
Answer explanation
Prices are usually written in decimal form (e.g. $xx.xx), so it's best to use a "double" variable.
Good variable names are easy to understand, short, and written in camelCase.
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
36 questions
Excel tercel parcial licenciatura
Quiz
•
9th Grade - University
28 questions
Mujeres ingeniosas
Quiz
•
10th Grade - Professi...
28 questions
INFO
Quiz
•
12th Grade - University
33 questions
Sumatif 1 - Bab Sistem Komputer
Quiz
•
10th Grade
35 questions
Quis Aplikasi Scratch
Quiz
•
9th Grade
30 questions
Programming Techniques
Quiz
•
8th - 10th Grade
30 questions
SINAQ (ONLINE)
Quiz
•
11th Grade
31 questions
Simple Machines Quiz 1
Quiz
•
7th - 9th Grade
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
39 questions
UNIT 7 and UNIT 8 — Multiple Choice Question Bank (Extracted)
Quiz
•
9th Grade
50 questions
Money Matters Fall 2025 Final Exam — Worksheet Questions
Quiz
•
12th Grade
47 questions
CSF Final Exam Practice
Quiz
•
9th - 12th Grade
