Independent assessment A: parcel dispatch
ห้องปฏิบัติการสอบอิสระ
นี่คือคำถามสไตล์ข้อสอบ AS 9618 ที่ใหม่และเป็นต้นฉบับ เวลาแนะนำคือ 35 นาที อ่านทุกส่วนก่อนตอบ ส่งคำตอบทั้งหมดพร้อมกัน; ตัวรันและตัวช่วยจะยังคงไม่สามารถใช้งานได้จนกว่าจะส่งทั้งหมด
การตรวจสอบแบบมีโครงสร้างให้คะแนน 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 นาที ตอบทุกส่วนก่อนส่ง การรัน การตรวจสอบ และคำแนะนำจะถูกซ่อนจนกว่าจะส่งคำตอบ จากนั้นคำตอบจะถูกล็อกเพื่อทบทวน