Search Header Logo

Intro: Arithmetic Expressions

Authored by Wayground CTE

Information technology (IT)

9th Grade

Blooms Level: Remember covered

Intro: Arithmetic Expressions
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

8 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which operator returns the remainder after integer division?

/

*

-

%

Answer explanation

The % operator is the modulus operator; it returns the leftover remainder after dividing two integers. The / operator returns the quotient, not the remainder.

Tags

Blooms Level: Remember

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the result of 7 / 2 in Java when both values are int?

3.5 (decimal result)

4 (rounded up)

3 (truncated)

2 (remainder only)

Answer explanation

Integer division in Java truncates toward zero, so 7 / 2 produces 3. To get 3.5, at least one operand must be a float or double.

Tags

Blooms Level: Apply

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which compound assignment operator subtracts a value from a variable?

=-

-=

--=

-%

Answer explanation

The -= operator subtracts the right operand from the variable and stores the result. The -- operator decrements by one but is not a compound assignment operator.

Tags

Blooms Level: Remember

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What does x *= 3; do when x is currently 4?

Sets x to 3

Sets x to 7

Sets x to 1

Sets x to 12

Answer explanation

The *= operator multiplies the variable by the right operand and stores the result; 4 * 3 equals 12. A common mix-up is reading *= as addition rather than multiplication.

Tags

Blooms Level: Apply

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

In Java, which operation is evaluated first in the expression 2 + 3 * 4?

2 + 3 (left to right)

3 * 4 (precedence)

2 + 12 (addition first)

All operations equally

Answer explanation

Multiplication has higher precedence than addition, so 3 * 4 is evaluated first, giving a final result of 14, not 20.

Tags

Blooms Level: Remember

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the value of result after: int result = 10 + 2 * 5 - 3;

20

57

15

17

Answer explanation

Multiplication runs first: 2 * 5 = 10, then left to right: 10 + 10 - 3 = 17. Evaluating strictly left to right without precedence gives the wrong answer of 57.

Tags

Blooms Level: Apply

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which expression correctly uses the addition compound assignment operator?

Total + = price

Total =+ price

Total => price

Total += price

Answer explanation

The += operator adds the right operand to the variable in one step. Writing =+ is a common mistake; it assigns a positive value rather than adding to the existing one.

Tags

Blooms Level: Remember

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?