What happens during a call?

F-CALLS-V4-3hard

Charge the right fee

An invoice tool reads due and paid days and amounts, then reports totals, overdue invoices and fees.

What needs to change

Repair feeFor so every fee matches the days late printed beside it.

Reproduce

  1. Use go run on the single-invoice sample, then Check work for late and early invoices.

Acceptance criteria

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

Notes

The file contains its imports, the Invoice struct, readInvoices, daysLate, lateFee and main.

main prints daysLate(invoice.Due, invoice.Paid) beside the fee.

charge func(int) int accepts a function value. The local adapter supplies its computed day count to that function and returns the resulting charge.

Sign in to open this exercise

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

Sign in