Independent assessment A: parcel dispatch
독립적 시험 워크숍
이는 새로운 AS 9618 시험 스타일의 원본 문제들입니다. 권장 시간은 35분입니다. 답하기 전에 모든 부분을 읽으십시오. 모든 답안을 함께 제출하십시오; 그 전까지는 Runner와 지원 기능이 사용 불가합니다.
구조적 검증은 추적에 2점, 경계 테스트에 2점, 완전한 알고리즘 하나당 6점을 부여합니다. 프로그래밍 부분은 모든 케이스가 통과할 때만 점수를 획득합니다. 이 연습 벤치마크는 Cambridge 채점 기준과는 별개입니다.
추론 상자에 루프 선택 이유, 거절 시 보존해야 할 상태, 각 매개변수의 목적을 설명하십시오. 제출 후 풀이 예시와 비교하십시오. 교사는 설명을 검토하고 부분 시험 점수를 부여해야 합니다; 출력 검증만으로는 이를 수행할 수 없습니다.
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분. 제출 전 모든 부분을 답변하십시오. 제출 후까지 실행, 검증 및 힌트는 제공되지 않습니다. 제출 시 답변이 잠기어 검토됩니다.