Inference, coercion, and conversion

F-CONV-V4-3hard

Total the ticket sales

A film club summarizes runtimes, reads its cue sheet and totals ticket sales.

What needs to change

Repair toCents and money so the ticket total is right to the cent.

Reproduce

  1. Pipe the sample sales into go run main.go and compare the total line.

Acceptance criteria

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

Notes

The file contains its imports, readLines and the complete main; the conversion and money helpers are editable.

Input: 1 to 100 finite base-10 prices with exactly two decimal places, each from -9999.99 to9999.99; refunds and net totals may be negative. The absolute sum is at most 99,999,900 cents, within the declared 32-bit signed target. The supplied reader receives valid data; it does not validate this domain.

Sign in to open this exercise

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

Sign in