Independent assessment A: parcel dispatch
独立試験ワークショップ
これらは新しいオリジナルの AS 9618 試験形式問題である。推奨時間は 35 分である。回答する前にすべての部分を読む。すべての回答を一緒に提出せよ。それまでランナーとサポートは利用できないままとする。
構造化されたチェックは、トレースに対して 2 ポイント、境界テストに対して 2 ポイント、各完全アルゴリズムに対して 6 ポイントを授与する。プログラミング部分はすべてのケースが通過した場合のみポイントを授与する。この実践ベンチマークはCambridge採点基準とは別物である。
推論ボックス内で、ループを選択した理由、拒否時に保持すべき状態、各パラメータの目的を説明せよ。提出後、worked answers と比較せよ。教員は説明を確認し、部分的な試験満点を割り当てるべきである。出力チェックのみではそれが不可能である。
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 NumberOfRequests (1 to 8), then NumberOfRequests 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.
フィードバックは提出後に表示されます。
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.
フィードバックは提出後に表示されます。
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分。提出前にすべての部分に答えてください。提出後まで、解答確認やヒントは表示されません。提出後はレビュー用に回答がロックされます。