Changing a caller’s value through a pointer

F-PARAM-V4-2medium

Fill the harvest basket

Repair the planning-file import helpers: add seedlings to a retained bed record, append picked quantities to a harvest record, then apply bulk additions and between-record transfers. All quantities describe the software’s plan and inventory records.

What needs to change

Repair harvest so the caller’s basket holds the picked fruit.

Reproduce

  1. Pipe the sample baskets into go run main.go and compare each basket line with the expected stdout.

Acceptance criteria

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

Notes

The file contains its imports, readLines and main, which retains an integer slice log and passes a pointer to its header. append returns the resulting slice value; a local header and the caller’s header can have different lengths.

Input: up to 100 "name basket picked" rows with a single-word name and whole counts from 0 to 100. The supplied caller starts a harvest log with basket, appends the picked entry through harvest and reports its sum. The supplied reader receives valid data.

Sign in to open this exercise

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

Sign in