Worked example
Whole meals funded: 8
Inputs
- Current lunch balance: 25
- Meal price: 3
- Scheduled lunch attendance days: 10
- Desired ending balance: 5
One meal per supplied attendance day at constant price.
Currency changes the labels, not the amounts. No exchange-rate conversion.
Divide current balance by meal price and round down.
Return the first unfunded attendance day, or zero if the plan is fully funded.
Add planned meal cost and ending balance, then subtract current balance.
One meal per supplied attendance day at constant price. Top-up day is an attendance-day index starting at 1, not a calendar date.
OpenStax: Solve proportions and their applications ↗Whole meals funded: 8
Whole meals funded: 13