Companion to the AP-Style MC Practice SetAP 风格选择题练习的解析配套
Unit 1: Creative Development第 1 单元:创造性开发CSP
Multiple Choice)—— 详细解析Each item restates the prompt and choices, marks the correct letter, and gives a brief justification. Trap distractors are called out where useful.每道题重述题干与选项、标出正确答案字母,并给出简明解析;对容易混淆的干扰项(trap distractor)单独提示。
A team is designing a bus arrival app. Its initial prototype assumes that everyone can read small text and has a reliable Internet connection.一个团队正在设计公交到站应用程序。其初始原型(prototype)假设所有人都能阅读小字号文字,并且都有可靠的互联网连接。
Which action is most likely to improve the app by incorporating diverse perspectives?以下哪项行动最可能通过纳入不同视角来改进该应用程序?
Developers in different locations are building a community resource directory. They disagree about which search features to prioritize.身处不同地点的开发者正在构建社区资源目录。他们对应该优先开发哪些搜索功能存在分歧。
Which two actions would most directly support effective collaboration? Select two answers. Select two answers.以下哪两项行动最能直接促进有效协作(collaboration)?请选择两个答案。 选择两个答案。
Two students use pair programming to implement a procedure. One writes code while the other reviews the work and discusses possible test cases; they periodically exchange roles.两名学生使用结对编程(pair programming)实现一个过程。一人编写代码,另一人审阅并讨论可能的测试用例;他们定期交换角色。
Which explanation best describes a potential benefit of their approach?以下哪项最能说明这种方法的潜在好处?
A program counts sensor readings that meet or exceed a threshold.一个程序统计达到或超过阈值(threshold)的传感器读数。
readings ← [3, 5, 5, 8, 2, 7] count ← 0 FOR EACH value IN readings { IF(value ≥ 5) { count ← count + 1 } } DISPLAY(count)
What value is displayed?显示的值是多少?
A developer uses two lists to prepare values for display.一位开发者使用两个列表(list)准备要显示的值。
a ← [4, 7, 9] b ← a REMOVE(b, 1) b[1] ← 9 DISPLAY(a[2]) DISPLAY(b[1])
What values are displayed, in order?依次显示哪些值?
An art app waits for the user to tap a color button. The tap causes the app to read the selected color and change the color displayed on the canvas.一个绘画应用程序等待用户点击颜色按钮。点击后,应用程序读取所选颜色,并改变画布上显示的颜色。
Which description correctly identifies the event, input, and output?以下哪项正确识别了事件(event)、输入(input)和输出(output)?
A robot is on a 3-by-3 grid. Columns increase from left to right and rows increase from bottom to top. The robot starts at column 2, row 1, facing north. The only black square is column 2, row 3; all other squares are open.一个机器人位于 3 行 3 列的网格上。列号从左到右递增,行号从下到上递增。机器人从第 2 列第 1 行出发,面向北方。唯一的黑色方格位于第 2 列第 3 行;其他方格均可通行。
REPEAT 3 TIMES { IF(CAN_MOVE(forward)) { MOVE_FORWARD() } ELSE { ROTATE_RIGHT() } }
Where is the robot, and which direction is it facing, after the program finishes?程序结束后,机器人位于何处,面向哪个方向?
A team builds a basic appointment app, tests it with users, revises the scheduling screen, and tests the revised screen again.一个团队先构建基本的预约应用程序,再让用户测试,根据反馈修改预约界面,然后再次测试修改后的界面。
Which description best characterizes this development process?以下哪项最能描述这一开发过程?
A developer maintains a program that calculates library fines. A comment says that a procedure returns a fine in cents, but the procedure was recently changed to return dollars.一位开发者维护一个计算图书馆罚款的程序。一条注释(comment)说明某过程返回以分为单位的罚款,但该过程最近已改为返回以元为单位的金额。
Which action best supports future maintenance?以下哪项行动最有利于今后的维护?
A student adapts a code segment written by another programmer for a class project. The student also modifies the segment to meet the project's requirements.一名学生为课堂项目改用了另一位程序员编写的代码片段(code segment),并对其进行了修改以满足项目要求。
Which documentation practice appropriately acknowledges the source?以下哪种文档做法适当地注明了来源?
A team is designing an app for reporting broken streetlights. The team has not yet decided which information the app should request or how reports should be submitted.一个团队正在设计用于报告路灯故障的应用程序。团队尚未确定应用程序应要求用户提供哪些信息,也未确定报告应如何提交。
Which two actions would help establish requirements before finalizing the design? Select two answers. Select two answers.在确定最终设计之前,以下哪两项行动有助于制定需求(requirements)?请选择两个答案。 选择两个答案。
A developer runs the following code to display every value in a list.一位开发者运行以下代码,以显示列表中的每个值。
values ← [2, 5, 8] i ← 1 REPEAT 4 TIMES { DISPLAY(values[i]) i ← i + 1 }
What is displayed before the program terminates due to an error?程序因错误终止之前显示了什么?
A developer tests a loop with an initial value at the stopping boundary.一位开发者用停止边界上的初始值测试一个循环。
n ← 5 total ← 0 REPEAT UNTIL(n ≥ 5) { total ← total + n n ← n + 1 } DISPLAY(total)
What value is displayed?显示的值是多少?
A procedure is intended to sum the positive even integers up to and including its parameter. A developer tests it with 8.一个过程(procedure)旨在求出不超过其参数的所有正偶数之和,包含参数本身。一位开发者使用 8 进行测试。
PROCEDURE sumEven(limit) { i ← 1 total ← 0 REPEAT UNTIL(i > limit) { IF(i MOD 2 = 0) { total ← total + i } i ← i + 1 } RETURN(total) } DISPLAY(sumEven(8))
What value does this test display?此次测试显示什么值?
A program must accept integer ages from 0 through 120, inclusive, and reject all other integer ages.一个程序必须接受从 0 到 120 的整数年龄,包括两个端点,并拒绝其他所有整数年龄。
Which set of test inputs best checks both boundaries and values just outside them?以下哪组测试输入最适合检查两个边界以及恰好位于边界之外的值?