AP CSA Primitive Types Practice

AP CSA Primitive Types Practice

11th Grade

22 Qs

quiz-placeholder

Similar activities

Java - 11TPI

Java - 11TPI

9th - 12th Grade

20 Qs

Asas JavaScript

Asas JavaScript

1st Grade - University

18 Qs

Name The Disney Animation Films

Name The Disney Animation Films

KG - University

20 Qs

Clean, Sanitize and Store Kitchen Tools and Equipment

Clean, Sanitize and Store Kitchen Tools and Equipment

11th - 12th Grade

20 Qs

Proses Komunikasi Data Pada Jaringan

Proses Komunikasi Data Pada Jaringan

11th Grade

20 Qs

History of Package Design

History of Package Design

9th - 12th Grade

20 Qs

NP IT Quiz ปริศนาไอที #4

NP IT Quiz ปริศนาไอที #4

9th - 12th Grade

20 Qs

Exam Style Questions

Exam Style Questions

10th - 11th Grade

18 Qs

AP CSA Primitive Types Practice

AP CSA Primitive Types Practice

Assessment

Quiz

Computers

11th Grade

Practice Problem

Medium

Created by

David Lakind

Used 66+ times

FREE Resource

AI

Enhance your content in a minute

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

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.

Access all questions and much more by creating a free account

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?