Question 1 of 10
A prize booth tracks unused stickers. What text does this Java code display?
int stickers = 14;
stickers += 9;
System.out.print(stickers);
- A. 14
- B. 23
- C. 9
- D. 15
A prize booth tracks unused stickers. What text does this Java code display?
int stickers = 14;
stickers += 9;
System.out.print(stickers);
A shuttle logs remaining fuel units. What text does this Java code display?
int fuel = 40;
fuel -= 17;
System.out.print(fuel);
A warehouse restacks identical cartons. What text does this Java code display?
int cartons = 6;
cartons *= 5;
System.out.print(cartons);
Ribbon is cut into equal 5-centimeter pieces. What text does this Java code display?
int ribbon = 23;
ribbon /= 5;
System.out.print(ribbon);
The leftover ribbon after making 5-centimeter pieces is needed. What text does this Java code display?
int ribbon = 23;
ribbon %= 5;
System.out.print(ribbon);
A recipe scales a double volume. What text does this Java code display?
double syrup = 9.0;
syrup /= 4;
System.out.print(syrup);
Compound assignment identifies the left-hand variable once, then stores the updated value there. What text does this Java code display?
int tokens = 11;
tokens += tokens;
System.out.print(tokens);
A contest score is updated in order. What text does this Java code display?
int score = 5;
score += 3;
score *= 4;
score -= 2;
System.out.print(score);
A lane counter uses a standalone postfix increment. What text does this Java code display?
int lane = 7;
lane++;
System.out.print(lane);
Consider this code:
int n = 20;
n /= 6;
Which statement is true about the value stored in n?