THINK FIRST·CODE LATER

← All labs

It compiles, but the answers are wrong

Problem

The program in the editor compiles and runs, yet five of its six results are wrong: these are logic errors, the kind the compiler cannot find. Fix the expressions (not the labels) so that the program prints:

Area: 20 m2
Perimeter: 18 m
Total minutes: 225
Average minutes: 75
Full groups: 4
Students left over: 1

The facts: a room of 5 m by 4 m; three lab sessions of 50, 75 and 100 minutes; 17 students in groups of 4.

Write it here or in your IDE, then paste it. Compile and test it yourself before comparing. Your code stays in your browser — it is never sent to or stored on the server.