Comp Prog Chapter 4 Test - Java

Comp Prog Chapter 4 Test - Java

Assessment

Assessment

Created by

Charles Richter

Computers

9th - 12th Grade

5 plays

Medium

Student preview

quiz-placeholder

25 questions

Show all answers

1.

MULTIPLE CHOICE

2 mins • 1 pt

The if-else statement will execute one group of statements if its boolean expression is true or another group if its boolean expression is false.

2.

MULTIPLE CHOICE

2 mins • 1 pt

All it takes for an OR expression to be true is for one of the subexpressions to be true.

3.

MULTIPLE CHOICE

2 mins • 1 pt

All it takes for an AND expression to be true is for one of the subexpressions to be true.

4.

MULTIPLE CHOICE

2 mins • 1 pt

If the expression on the left side of the && operator is false, the expression on the right side will not be checked.

5.

MULTIPLE CHOICE

2 mins • 1 pt

A random number, created as an object of the Random class, is always an integer.

6.

MULTIPLE CHOICE

2 mins • 1 pt

In an if-else statement, if the boolean expression is false

7.

MULTIPLE CHOICE

2 mins • 1 pt

______ operators are used to determine whether specific relationships exists between two values.

8.

MULTIPLE CHOICE

2 mins • 1 pt

A block of code is enclosed in a set of

9.

MULTIPLE CHOICE

2 mins • 1 pt

The boolean expression in an if statement must evaluate to

10.

MULTIPLE CHOICE

2 mins • 1 pt

What will be the values of ans, x, and y after the following statements are executed? int ans = 35, x = 50, y = 50;

if (x >= y)

{ans = x + 10;x -= y;}

else

{ans = y + 10;y += x;}

Explore all questions with a free account

or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?