Unit 1: Primitive Types - AP Computer Science A
Quiz
•
Computers
•
9th - 12th Grade
•
Hard
Arasaka Teacher
FREE Resource
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
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
30 questions
AD S2 G360s Week 9 -2021
Quiz
•
12th Grade
30 questions
EDUCACION ARTISTICA 4TO SECUNDARIA-TAREA
Quiz
•
4th - 10th Grade
30 questions
giữa kì 2 tin hoc 9
Quiz
•
9th Grade
35 questions
ICTSM SEM-2 MOD-7 : Laptop
Quiz
•
10th Grade
28 questions
4QICT12 - Current and Future Trends of Media and Information
Quiz
•
11th - 12th Grade
30 questions
GCSE Computer Science: Topic 3 Consolidation
Quiz
•
10th - 11th Grade
30 questions
Quiz BK dan Literasi Digital
Quiz
•
9th Grade
36 questions
PARTS OF COMPUTER TEST
Quiz
•
12th Grade
Popular Resources on Wayground
10 questions
Honoring the Significance of Veterans Day
Interactive video
•
6th - 10th Grade
10 questions
Exploring Veterans Day: Facts and Celebrations for Kids
Interactive video
•
6th - 10th Grade
19 questions
Veterans Day
Quiz
•
5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
15 questions
Circuits, Light Energy, and Forces
Quiz
•
5th Grade
6 questions
FOREST Self-Discipline
Lesson
•
1st - 5th Grade
7 questions
Veteran's Day
Interactive video
•
3rd Grade
20 questions
Weekly Prefix check #2
Quiz
•
4th - 7th Grade
