Skip to content

The Create Performance Task

Python for AP CS Principles Lesson 15 2:14 English narration · English + 中文 subtitles burned in

space play · ←/→ 5s · j/l 10s · f fullscreen · ,/. speed

Chapters

Transcript
The Create Performance Task is a small program you design and build yourself, and it has a short list of requirements. Create 表现性任务,是一个由你自己设计并写出来的小程序, 它有一份不长的要求清单。
A list, or another collection, that stores many values. 一个列表,或者别的集合,用来装很多个值。
A procedure that takes at least one parameter — and one you actually call in your code, because defining it is not enough. 一个至少带一个参数的过程—— 而且是你在代码里"真的调用"了的,因为光定义还不算。
An algorithm with selection inside iteration: an if nested inside a loop, not simply both present. 一个"选择套在迭代里面"的算法: 是 if 嵌在循环里面,而不是两样各有一份。
And some input and some output. 还要有一些输入和一些输出。
Here is a scaffold that has every required part, and your real job is finding them — because that is exactly what you will have to do with your own program. 这是一个把每一项要求都包含进去的骨架, 而你真正的任务是"把它们找出来"—— 因为对你自己的程序,你要做的正是这件事。
The list is line one. 列表在第 1 行。
The procedure with its parameter is line two. 带参数的过程在第 2 行。
Line eight is where you call it. 第 8 行是你调用它的地方。
Lines seven and nine are the loop and the if inside it. 第 7 行和第 9 行,是循环和套在它里面的 if。
And line eleven is the output. 而第 11 行是输出。
Half of this task is not code at all. 这个任务有一半根本不是代码。
You have to explain your program in writing. 你必须用文字把你的程序讲清楚。
What is its purpose, and why is it useful? 它的目的是什么,为什么有用?
What does your list store, and why is one list simpler to manage than many separate variables? 你的列表装的是什么, 为什么用一个列表比用很多个各自的变量更好管理?
And describe the algorithm inside your loop, pointing to where it uses selection and where it uses iteration — in your own words. 再描述一下循环里面那个算法, 指出它在哪里用了选择、在哪里用了迭代—— 用你自己的话说。
So work down this checklist against your own program. 所以拿这份清单,对着你自己的程序一条条过。
A list is used. 用到了一个列表。
A procedure is defined with at least one parameter. 定义了一个至少带一个参数的过程。
That procedure is called somewhere. 这个过程在某处被调用了。
Selection sits inside iteration. 选择套在迭代里面。
The program has input and output. 程序有输入也有输出。
And I can explain every part in my own words. 而且我能用自己的话把每一部分讲清楚。
Start small, run it often, and fix one thing at a time. 从小处开始,常常跑一跑,一次只改一个地方。
Four things to close the course. 用四点给这门课收尾。
One: pick a small idea you can explain completely. 第一:挑一个你能完整讲明白的小题目。
Two: the if must sit inside the loop, not beside it. 第二:那个 if 必须在循环"里面",不是并排放着。
Three: define the procedure and call it. 第三:过程要定义,也要调用。
Four: the real task is submitted to AP through the Digital Portfolio, not to this site. 第四:真正的任务是通过 Digital Portfolio 交给 AP 的,不是交到本站。
Practise here first — and well done for getting to the end. 先在这里练—— 也恭喜你走到了最后。

Log in or create account

IGCSE, A-Level & AP