Independent assessment A: parcel dispatch
Independent exam workshop
These are fresh, original AS 9618 exam-style questions. Suggested time is 35 minutes. Read every part before answering. Submit all answers together; the runner and support stay unavailable until then.
The structured checks award 2 points for tracing, 2 for boundary tests, and 6 for each complete algorithm. A programming part earns its points only when every case passes. This practice benchmark is separate from a Cambridge mark scheme.
In the reasoning box, explain your loop choice, the state that must be preserved on refusal, and the purpose of each parameter. After submission, compare with the worked answers. A teacher should review explanations and assign partial exam marks: output checks cannot do that.
Available begins at 24. Process requests [12, 0, 12, 25]: accept positive requests no larger than Available and subtract accepted amounts. Give Available after EACH request.
Valid quantities for an unchanged stock of 6 are 1 to 6 inclusive. Give FOUR boundary values in ascending order, including the immediately invalid values.
For parcel dispatch, read non-negative Available, then N (1 to 8), then N integer requests. Accept a request only if positive and no greater than current Available. Output ok/no for every request, then final Available. Refused requests must not change it.
Feedback appears after submission.
Write only FUNCTION CountLong(FileName : STRING, Limit : INTEGER) RETURNS INTEGER. Read the supplied text file, return how many lines have length at least Limit, and close it. The file may be empty.
Feedback appears after submission.
Explain your choice of data structure and loop. Identify one boundary case and predict its result. For a subroutine, explain what is returned or changed in the caller.
Saved for this sitting on this browser. Review this yourself or with your teacher; these explanations are not automatically marked.
Review your explanation against these criteria
- My types and data structure match the data and the question.
- I justified the loop and checked its first and last iterations.
- Initial values and rejected operations preserve the intended state.
- My test includes input, purpose and expected result.
- I distinguished returning a value from printing and changing caller state.
Suggested time: 35 minutes. Answer every part before submitting. Running, checking and hints are withheld until submission. Answers are then locked for review.