Reactor Cooling Diagnostics – Task 1

Shortly after arriving on Erebos Station, you are given access to the reactor control wing. The main reactor is old but stable, provided its cooling system operates within acceptable limits. To ensure this, the station continuously measures cooling efficiency and writes the results to a diagnostic log file.

The cooling monitor was designed to be simple. Once per minute, it records the current time, identifies the subsystem that produced the measurement, and appends the measured efficiency as a percentage. The format was chosen so that engineers could read it directly during emergencies, not so that programs could process it easily.

The crew needs a quick way to summarize recent cooling performance. Rather than reading the log line by line, they want a small Java program that can extract the relevant values and present a clear overview.

You are provided with a log file named cooling_log.txt. The actual file used by the station is very large, containing hundreds of measurements, and your program is expected to read and process the full file rather than relying on manually entered data.

Each line in the file represents one measurement and follows this format:

08:12 ReactorCooling: efficiency=42%
08:13 ReactorCooling: efficiency=38%
08:14 ReactorCooling: efficiency=41%
08:15 ReactorCooling: efficiency=39%
08:16 ReactorCooling: efficiency=44%
08:17 ReactorCooling: efficiency=40%

Only the numerical value associated with efficiency is relevant for this task.

Your program should read the file, process every measurement it contains, and report how many measurements were recorded, what the average cooling efficiency is, and what the highest recorded efficiency was. The result should give the crew immediate confidence that the cooling system is behaving as expected — or alert them if it is not.

For the example data shown above, a correct program would produce output similar to:

Measurements: 6
Average efficiency: 40%
Highest efficiency: 44%

As you work through the log, it becomes clear that other subsystems produce similar reports, each with their own quirks and formats. For now, your focus is only on the reactor cooling system. Understanding this log is the first step toward understanding the station as a whole.