Independent assessment B: equipment inspections
独立考试工作坊
这些是全新的原创 AS 9618 考试风格题目。建议时间为 35 分钟。答题前阅读所有部分。一起提交所有答案;在提交之前,运行器和辅助工具保持不可用状态。
结构化检查为追踪赋值2分,边界测试赋2分,每个完整算法各赋6分。编程部分仅在所有用例均通过时才能获得分数。此练习基准独立于剑桥评分标准。
在推理框中说明选择循环的原因、拒绝时必须保持的状态以及每个参数的用途。提交后与范例答案进行比对。教师应审查解释并评定部分考试分数:输出检查无法做到这一点。
A 2 by 3 array contains rows [8, 4, 6] and [3, 9, 5]. Total is reset to 0 for each row, then values are added left to right. Give Row, Col, Total after EVERY inner iteration, one triple per line.
Valid quantities for an unchanged stock of 7 are 1 to 7 inclusive. Give FOUR boundary values in ascending order, including the immediately invalid values.
Read NumberOfItems (1 to 4), then THREE non-negative integer inspection scores per item, item by item. Store a 2-D array. Output each item total, then the 1-based index of the LOWEST-total item. Choose the first on a tie.
提交后显示反馈。
Write only PROCEDURE Borrow(BYREF Stock : INTEGER, BYVAL Wanted : INTEGER, BYREF Success : BOOLEAN). Accept only positive requests no greater than Stock. Set Success on EVERY call. Decrease Stock only on success. Do not OUTPUT.
提交后显示反馈。
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.
本次答案保存在本浏览器。请自行或与老师复核;文字解释不自动评分。
按要点复核解释
- 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.
建议用时:35 分钟。完成全部题目后提交。提交前不能运行、检查或查看提示;提交后答案锁定供复习。