Unit 3 If statements Quiz

Unit 3 If statements Quiz

9th - 12th Grade

13 Qs

quiz-placeholder

Similar activities

Kapasitas Kanal Komunikasi

Kapasitas Kanal Komunikasi

1st - 10th Grade

13 Qs

Test- zaj. komp - klasa 4

Test- zaj. komp - klasa 4

KG - University

14 Qs

Testing Software

Testing Software

9th - 12th Grade

9 Qs

Tin học 11_Bài 456

Tin học 11_Bài 456

11th Grade

14 Qs

Electronic Component

Electronic Component

10th Grade

15 Qs

MODULE 8 PRE TEST

MODULE 8 PRE TEST

10th Grade

10 Qs

Installing and Carrying Out  Variation of Application Software

Installing and Carrying Out Variation of Application Software

10th Grade

10 Qs

J277 - 1.1 Systems Architecture MCQs 2

J277 - 1.1 Systems Architecture MCQs 2

10th - 11th Grade

11 Qs

Unit 3 If statements Quiz

Unit 3 If statements Quiz

Assessment

Quiz

Computers

9th - 12th Grade

Medium

Created by

Karen Russo

Used 10+ times

FREE Resource

AI

Enhance your content

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

13 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Pick the value that best completes the sentence: A boolean variable has _______ value(s).

only one valid

two valid

three valid

only invalid

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What mathematical symbol/word does the symbol && in java represent?

and

or

average

absolute value

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What does the symbol ! mean in a boolean expression?

Always use 0 for x

Always true

Never true

Not

4.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

If x = 5, y = 10 and z = 10, the expression

(x < y) && !(y ==z)

will return the value of _______________.

true

false

null

cannot be determined

5.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

What will be the output for the following program segment?

int num = 20;

if (num > 0)

if (num % 5 == 0)

System.out.println(num);

else System.out.println(num + " is negative ");

20

4

4 is negative

20 is negative

6.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

What line of code would replace the following algebraic inequality?

 3  x < 5-3\ \le\ x\ <\ 5  

-3 < x || x < 5 

-3 <= x || x < 5

-3 < x && x < 5 

-3 < = x && x < 5 

7.

MULTIPLE CHOICE QUESTION

5 mins • 1 pt

Consider the following code assuming the variables have been properly defined.

String mystery_word = new String ("Comp Sci ");

System.out.println ("Enter a word ");

String word = reader.nextLine();

// compare the word to the mystery word

if (*** line of code goes here ****)

System.out.println ( "your word matches");

else

System.out.println ("The words do not match");

What is the proper code to compare the two words?

! (word.equals(mystery_word))

! ( word == mystery_word)

(word.equals(mystery_word))

(word == mystery_word)

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

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?