AP Computer Science-Quiz 2(G10)

AP Computer Science-Quiz 2(G10)

9th - 12th Grade

10 Qs

quiz-placeholder

Similar activities

CodeHS: Unit 6 - JavaScript Basics

CodeHS: Unit 6 - JavaScript Basics

9th Grade

15 Qs

JavaScript and Graphics

JavaScript and Graphics

9th - 12th Grade

15 Qs

Java G10 IT 1 - intro and conditionals

Java G10 IT 1 - intro and conditionals

10th Grade

12 Qs

basics of javascript

basics of javascript

9th - 12th Grade

11 Qs

G12_Week7

G12_Week7

12th Grade - University

10 Qs

java

java

10th Grade

15 Qs

Arrays

Arrays

10th - 12th Grade

10 Qs

REVIEW QUIZ FOR & WHILE LOOP

REVIEW QUIZ FOR & WHILE LOOP

10th Grade

10 Qs

AP Computer Science-Quiz 2(G10)

AP Computer Science-Quiz 2(G10)

Assessment

Quiz

Computers

9th - 12th Grade

Easy

Created by

fareeda k

Used 2+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

1. In Java, which keyword is used to declare an integer variable?

 

int

double

char

boolean

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

2. What is the output of the following code snippet?

             int num = 10;

             num = num + 5;

             System.out.println(num);

5

10

15

20

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

  1. 3. Primitive data types in Java include int, double, char, and boolean.

True

False

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

  1. 4. Which operator is used to compare if two values are not equal in Java?

==

!=

>

 <

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

  1. 5. What is the correct syntax for an if statement in Java?

`if condition { }`

`if (condition) { }`

`if (condition); { }`

`if {condition} ( )`

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

6. Which of the following is a logical operator in Java?

&&

!=

==

>

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

7. An if-else statement can be used to execute one block of code if a condition is true and another block of code if the condition is false.

True

False

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?