Unit 1: Primitive Types - AP Computer Science A

Unit 1: Primitive Types - AP Computer Science A

9th - 12th Grade

33 Qs

quiz-placeholder

Similar activities

Computer Pretest(Arduino)

Computer Pretest(Arduino)

12th Grade

33 Qs

1.1.1. Structure and function of the processor

1.1.1. Structure and function of the processor

12th Grade

34 Qs

ĐỀ CƯƠNG ÔN TẬP CÔNG NGHỆ 4 CUỐI KỲ 2

ĐỀ CƯƠNG ÔN TẬP CÔNG NGHỆ 4 CUỐI KỲ 2

10th Grade

32 Qs

Próbny EE.09

Próbny EE.09

10th Grade

29 Qs

dasar desain grafis

dasar desain grafis

10th Grade

33 Qs

THIẾT KẾ BÀI TRÌNH CHIẾU LỚP 9

THIẾT KẾ BÀI TRÌNH CHIẾU LỚP 9

9th Grade

28 Qs

Computer System

Computer System

11th Grade

28 Qs

ÔN TẬP CUỐI HK2 TIN HỌC 6 24-25

ÔN TẬP CUỐI HK2 TIN HỌC 6 24-25

6th Grade - University

30 Qs

Unit 1: Primitive Types - AP Computer Science A

Unit 1: Primitive Types - AP Computer Science A

Assessment

Quiz

Computers

9th - 12th Grade

Hard

Created by

Arasaka Teacher

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

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.

Declare
Initialize
Start
Create
Make

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..

Good variable names improve code efficiency.
Good variable names reduce the size of the code.
Good variable names make the code run faster.

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

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?