Keep each rule’s bonus
First select the highest entry using the supplied comparison callback, keeping the earlier entry on a tie. Then publish one rule at each bonus setting and evaluate those rules later, after the setting has changed. Finally normalize each heat: read fractional marks exactly, remove no-shows coded as 0, apply this meet’s below-6 adjustment and reconcile the count of adjusted marks across all heats.
What needs to change
Repair score_rules so each rule keeps the bonus it was made with.
Reproduce
- The starter does not compile; read the diagnostic before changing the code.
Acceptance criteria
Your review marks · Saved in this browser. Test acceptance is tracked separately.
Notes
The file contains its imports, read_lines and the complete main.
Input: up to 100 valid command lines. "bonus N" sets a signed decimal whole bonus -1000..1000, and "rule" publishes a rule; fields use ordinary spaces/tabs and leading zeros are allowed. Rules are called after command processing. The supplied reader receives valid data.