Absence, zero, and empty values

F-ABSENCE-V4-2medium

Report who answered

A coffee survey records cups per day, where 0 is a real answer and a blank means the question was skipped.

What needs to change

Repair describe so each reported name shows as answered, blank or not surveyed.

Reproduce

  1. Compile and run the sample report with g++, then compare each reported name and the surveyed line with the expected stdout.

Acceptance criteria

Your review marks · Saved in this browser. Test acceptance is tracked separately.

Notes

The file contains its headers, readLines, cut, parseAnswer and main. The browser compiles with g++ -std=c++23.

Input: answer lines, then a last line that starts with report and lists names. answers maps each surveyed name to a std::optional<int>.

Pilot input: at most five distinct surveyed people with single-token names and whole answers from 0 to 20 or blanks, followed by the supplied report command, with one separating space as shown. Requested names may be absent or repeated. The reader does not validate these bounds.

Sign in to open this exercise

The ticket brief is public. Sign in to access the exercise. Paid exercises require Pro.

Sign in