📚 Year 9 SQA Computing: Summer Prep and Bridging Course | SQA 计算机:暑期预习与衔接课程
Welcome to your summer preparation programme for SQA Computing! This bridging course is designed to help you build a solid foundation in computing concepts and programming skills before entering Year 10 or starting your National qualification journey. We will explore computational thinking, Python programming, computer systems, data representation, networks, and online safety through engaging explanations and hands-on examples. By working through these topics, you will feel confident and ready to tackle the challenges of the new academic year.
欢迎参加SQA计算机暑期预习课程!这门衔接课程旨在帮助您在进入十年级或开始国家资格课程之前,打下计算机概念和编程技能的坚实基础。我们将通过生动的解释和动手实例,探索计算思维、Python编程、计算机系统、数据表示、网络以及在线安全知识。通过完成这些主题的学习,您将充满信心,准备好迎接新学年的挑战。
1. What is Computational Thinking? | 什么是计算思维?
Computational thinking is a problem-solving approach that uses concepts from computer science. It involves four key techniques: decomposition (breaking down a complex problem into smaller, manageable parts), pattern recognition (identifying similarities or trends), abstraction (focusing on the essential information while ignoring irrelevant details), and algorithm design (creating step-by-step instructions to solve a problem).
计算思维是一种运用计算机科学概念来解决问题的方法。它包含四种关键技术:分解(将复杂问题拆分成更小、可管理的部分)、模式识别(找出相似之处或趋势)、抽象(专注于必要信息而忽略无关细节)和算法设计(创建分步指令来解决问题)。
For instance, if you need to create a simple maths quiz app, you can use decomposition to break the task into smaller chunks: designing the user interface, writing the code to generate questions, checking answers, and keeping score. Pattern recognition might help you notice that many quiz questions follow a similar template, allowing you to reuse a function. Abstraction lets you ignore the aesthetics of the app initially and focus on the core logic.
例如,如果你需要创建一个简单的数学测验应用,你可以使用分解将任务拆分成小块:设计用户界面、编写生成题目的代码、检查答案和统计分数。模式识别能帮助您发现许多测验题目遵循相似的模板,从而可以复用一个函数。抽象让您一开始忽略应用的外观,专注于核心逻辑。
Algorithms are everywhere – from recipes to directions on a map. In computing, they are the backbone of all programs. By thinking computationally, you learn to solve problems in a structured way that can be easily translated into code.
算法无处不在——从食谱到地图导航。在计算机中,它们是所有程序的支柱。通过计算思维,您将学会用结构化的方式解决问题,并能轻松转化为代码。
2. Getting Started with Python | 开始使用Python
Python is a popular, beginner-friendly programming language used in SQA Computing. Its syntax is clear and readable, making it an excellent choice for your first language. You can write and run your first program by installing an Integrated Development Environment (IDE) such as Thonny or PyCharm, or by using an online editor like Replit.
Python是一种流行且对初学者友好的编程语言,在SQA计算机课程中广泛使用。它的语法清晰易读,是非常适合初学的语言。您可以安装集成开发环境(IDE)如Thonny或PyCharm,或使用在线编辑器如Replit来编写并运行您的第一个程序。
The traditional first program displays a greeting: print("Hello, World!"). The print() function outputs whatever is inside the parentheses to the console. Notice that the text must be enclosed in quotation marks. You can also use single quotes, but consistency is key.
传统上的第一个程序会显示问候语:print("Hello, World!")。print()函数会将括号内的内容输出到控制台。请注意,文本必须用引号括起来。您也可以使用单引号,但保持一致是关键。
It is good practice to add comments in your code to explain what it does. In Python, a comment starts with a hash symbol: # This is a comment. Comments are ignored by the computer and are meant for humans reading the code.
在代码中添加注释来解释其用途是一个好习惯。在Python中,注释以井号开头:# 这是一个注释。计算机会忽略注释,它们是为阅读代码的人准备的。
3. Variables and Data Types | 变量与数据类型
Variables are used to store data in a program. You can think of them as labelled boxes that hold values. In Python, you create a variable by assigning a value with the equals sign: score = 10. Variable names must start with a letter or underscore and cannot contain spaces or special characters.
变量用于在程序中存储数据。你可以把它们想象成贴有标签的盒子,里面装着数值。在Python中,通过用等号给名称赋值来创建变量:score = 10。变量名必须以字母或下划线开头,不能包含空格或特殊字符。
| Data Type (EN) | 数据类型 (中文) | Example |
|---|---|---|
| Integer (int) | 整数 | 5, -3, 2024 |
| Float | 浮点数 | 3.14, -0.001 |
| String (str) | 字符串 | "Hello", 'A' |
| Boolean (bool) | 布尔值 | True, False |
Python determines the data type automatically based on the value assigned. However, you can explicitly convert between types using functions like int(), float(), str(), and bool(). Type conversion is essential when you need to combine data of different types; for example, concatenating a string with a number requires converting the number to a string first.
Python会根据赋值的值自动确定数据类型。不过,您可以使用int()、float()、str()和bool()等函数在不同的类型之间进行显式转换。当需要组合不同类型的数据时,类型转换必不可少;例如,将字符串与数字连接需要先将数字转换为字符串。
4. Input and Output | 输入与输出
Interactive programs need to receive input from users. The input() function waits for the user to type something and press Enter. Whatever the user types is returned as a string. To store the input, you assign it to a variable: name = input("What is your name? ").
交互式程序需要接收用户的输入。input()函数会等待用户输入内容并按下回车键。用户输入的任何内容都会以字符串的形式返回。为了存储输入,您需要将它赋值给一个变量:name = input("What is your name? ")。
If you want to work with numbers, you must convert the string to an integer or float. For instance: age = int(input("How old are you? ")). Failing to convert will result in a type error when you try to perform arithmetic operations. You can also format output more neatly using f-strings: print(f"Hello, {name}, you are {age} years old.").
如果要处理数字,您必须将字符串转换为整数或浮点数。例如:age = int(input("How old are you? "))。如果不进行转换,当您尝试执行算术运算时,将会出现类型错误。您还可以使用f-string更整齐地格式化输出:print(f"Hello, {name}, you are {age} years old.")。
5. Making Decisions with Conditionals | 使用条件语句进行判断
Programs often need to make decisions and execute different code depending on conditions. In Python, the if statement is used to check a Boolean expression. If the expression is True, the indented block below the if statement runs. You can extend the decision with elif (else if) and else to handle multiple scenarios.
程序经常需要做出决策,并根据条件执行不同的代码。在Python中,if语句用于检查布尔表达式。如果表达式为True,则运行if语句下方缩进的代码块。您可以添加elif(else if)和else来处理多种情况。
Comparison operators form the conditions: == (equal to), != (not equal to), <, >, <=, >=. Logical operators and, or, not combine conditions. Example: if score >= 90: grade = "A" elif score >= 75: grade = "B" else: grade = "C". Proper indentation is crucial in Python; a block is defined by the same level of indentation.
比较运算符构成条件:==(等于)、!=(不等于)、<、>、<=、>=。逻辑运算符and、or、not可以组合条件。示例:if score >= 90: grade = "A" elif score >= 75: grade = "B" else: grade = "C"。在Python中,正确的缩进至关重要;代码块由相同的缩进级别定义。
6. Repeating Actions with Loops | 使用循环重复操作
Loops allow you to repeat a set of instructions without writing the same
Published by TutorHao | Year 9 Computer Science Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)

或截图后用「扫一扫 → 相册」选择本图