Question 1 of 10
A garden inventory removes used seed packs. What text does this Java code display?
int packs = 27;
packs -= 8;
System.out.print(packs);
- A. 35
- B. 8
- C. 19
- D. 27
A garden inventory removes used seed packs. What text does this Java code display?
int packs = 27;
packs -= 8;
System.out.print(packs);
Each tray is copied onto 7 shelves. What text does this Java code display?
int trays = 4;
trays *= 7;
System.out.print(trays);
Seedlings are grouped into rows of 7. What text does this Java code display?
int leftover = 31;
leftover %= 7;
System.out.print(leftover);
Soil mass is recorded as a double. What text does this Java code display?
double mass = 2.5;
mass += 1.75;
System.out.print(mass);
Catalog pages are split among 8 binders using int division. What text does this Java code display?
int pages = 50;
pages /= 8;
System.out.print(pages);
A plot counter is updated, then multiplied by its own stored value. What text does this Java code display?
int plots = 3;
plots += 5;
plots *= plots;
System.out.print(plots);
Which description of owed += fee; is accurate for simple numeric variables?
A kiln cools by one degree, then a guard adds fuel. What text does this Java code display?
int heat = 12;
heat--;
heat += 4;
System.out.print(heat);
A volunteer needs to replace rain = rain % 10; with a compound assignment. Which statement is equivalent?
A hose length is scaled, then shortened. What text does this Java code display?
double length = 8.0;
length *= 0.5;
length -= 1.0;
System.out.print(length);