
B4 - Increment, Decrement, and Assignment Operators

Quiz
•
Other
•
University
•
Medium
R3g Gaming
Used 9+ times
FREE Resource
Student preview

10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the most common operation performed by a program?
Adding integer one to an integer variable.
Floating point division.
Object construction.
Internet access.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What two steps are performed when an assignment statement is executed?
- The expression on the right of the "=" is evaluated, "using" all the variables it contains.
- The result of evaluation is assigned to the variable on the left of the "=".
- All appropriate variables are incremented or decremented.
- The result is assigned to the variable on the left of the "=".
- All appropriate variables are incremented.
- All appropriate variables are decremented.
- The arithmetic expression is evaluated and assigned to the variable on the left of the "=".
- Variables are auto-incremented or auto-decremented.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the meaning of variable++ ?
Add one to the variable.
Add one to the variable after its current value has been used.
Add one to the variable before using its value.
Double the value in the variable.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the following program output to the monitor:
int value = 0;
int count = 1;
value = count++ ;
System.out.println("value: "+ value " + count: " + count );
value: 0 count: 0
value: 0 count: 1
value: 1 count: 1
value: 1 count: 2
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the following program output to the monitor:
int value = 0;
int count = 1;
value = ++ count ; /* note change from previous */
System.out.println("value: "+ value " + count: " + count );
value: 0 count: 1
value: 1 count: 1
value: 1 count: 2
value: 2 count: 2
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following:
int a = 0;
int b = 10;
a = --b ;
System.out.println("a: " + a + " b: " + b );
a: 9 b:11
a: 10 b: 9
a: 9 b:9
a: 0 b:9
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following program:
double w = 12.5 ;
w *= 2 ;
System.out.println( " w is " + w );
w is 12.5
w is 13.5
w is 25.0
w is 2
Create a free account and access millions of resources
Popular Resources on Wayground
50 questions
Trivia 7/25

Quiz
•
12th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
11 questions
Negative Exponents

Quiz
•
7th - 8th Grade
12 questions
Exponent Expressions

Quiz
•
6th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
20 questions
One Step Equations All Operations

Quiz
•
6th - 7th Grade
18 questions
"A Quilt of a Country"

Quiz
•
9th Grade