Java Summative Assessment 2

Java Summative Assessment 2

12th Grade

20 Qs

quiz-placeholder

Similar activities

Design Concept, Corporate Identity and Folder Management

Design Concept, Corporate Identity and Folder Management

12th Grade

16 Qs

Google

Google

7th - 12th Grade

20 Qs

Lecture Exercise Topic 1.3

Lecture Exercise Topic 1.3

12th Grade

21 Qs

Logika & Pemrograman (ID)

Logika & Pemrograman (ID)

10th Grade - Professional Development

20 Qs

quiz_G10

quiz_G10

12th Grade

20 Qs

Quiz1_12&11_2t_20214

Quiz1_12&11_2t_20214

12th Grade

20 Qs

Quiz 01 Keamanan Jaringan

Quiz 01 Keamanan Jaringan

12th Grade

17 Qs

UAS TLJ

UAS TLJ

9th - 12th Grade

15 Qs

Java Summative Assessment 2

Java Summative Assessment 2

Assessment

Quiz

Computers

12th Grade

Practice Problem

Easy

Created by

chrisbenedict sevilleno

Used 1+ times

FREE Resource

AI

Enhance your content in a minute

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

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of this code?

```java

int x = 5;

if (x > 0) {

System.out.println("Positive");

} else {

System.out.println("Negative");

}

Positive

Negative

Nothing

Error

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which symbol is used for the "not equal to" comparison in an if statement?

`!=`

`==`

`>`

`<>`

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will this code print?

```java

int age = 16;

if (age >= 18) {

System.out.println("Adult");

} else {

System.out.println("Minor");

}

```

Adult

Minor

Nothing

Error

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct syntax for an if-else statement?

`if condition { } else { }`

`if (condition) { } else { }`

`if [condition] { } else { }`

`if condition then { } else { }`

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will this code output?

```java

int num = 10;

if (num % 2 == 0) {

System.out.println("Even");

} else {

System.out.println("Odd");

}

Even

Odd

Nothing

Error

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does this code print?

```java

boolean isSunny = false;

if (isSunny) {

System.out.println("Go outside");

} else {

System.out.println("Stay inside");

}

Go outside

Stay inside

Nothing

Error

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is missing in this code to make it compile?

```java int x = 7;

if x > 5 {

System.out.println("Big");

}

```

Parentheses around the condition

Curly braces

Semicolon after the condition

A variable declaration

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?