📚 Case Study Practice: Solving Real-World Computer Problems | 案例分析实战演练:解决现实计算机问题
Computer science is not just about learning theories – it is about using those ideas to fix problems, design solutions and make better decisions. In this case study practice, you will explore ten real-life scenarios that Year 7 students often meet, and you will learn how to apply your computing knowledge step by step. Each case challenges you to think like a computer scientist, breaking down a problem, identifying the key facts and recommending a clear solution.
计算机科学不仅是学习理论,更是用这些想法来解决问题、设计解决方案并做出更优决策。在这次案例分析实战中,你将探索十个七年级学生常见的真实场景,并逐步学习如何运用你的计算机知识。每个案例都要求你像计算机科学家一样思考,分解问题、确定关键事实并提出清晰的解决方案。
1. Case 1: The Slow Computer | 案例一:运行缓慢的计算机
Sarah has been using her laptop for schoolwork and gaming. Over the past few weeks, the machine has become very slow, and sometimes programs freeze. She has saved many large video files and installed several free games. Sarah wants to know why her computer is sluggish and how to speed it up. She also notices that the fan is running loudly all the time.
莎拉一直用她的笔记本电脑做作业和玩游戏。过去几周,这台电脑变得非常慢,有时程序会卡住。她保存了很多大型视频文件,还安装了几个免费游戏。莎拉想知道为什么她的电脑反应迟钝,以及如何让它变快。她还注意到风扇一直在呼呼地大声转动。
First, we consider the hardware resources. A computer uses RAM to hold data of running programs. If too many apps are open or the RAM is small, the system slows down. Sarah might have many background processes. Checking the Task Manager (Ctrl+Shift+Esc) reveals CPU and memory usage. Also, a full storage drive – especially if the hard disk is more than 85% full – can cause poor performance. Moving large files to an external drive or cloud storage will free space. The loud fan suggests the CPU is hot, likely because it is working too hard.
首先,我们考虑硬件资源。计算机使用内存(RAM)来存放正在运行程序的数据。如果打开太多应用或内存较小,系统就会变慢。莎拉可能有许多后台进程。打开任务管理器(Ctrl+Shift+Esc)可查看 CPU 和内存使用情况。另外,存储驱动盘快满了——尤其是硬盘使用超过 85% 时——会导致性能变差。把大文件转移到外置硬盘或云存储可以释放空间。风扇声音大说明 CPU 温度高,很可能是因为它工作太吃力。
Next, software issues may be responsible. Some free games come with adware or unwanted toolbars that run at startup. Uninstalling unnecessary software through the Control Panel and disabling startup programs can help. Running a full virus scan with Windows Security will detect and remove malware. Finally, updating the operating system ensures the laptop has the latest performance patches. Sarah followed these steps and her computer became much faster.
接下来可能是软件问题。一些免费游戏会携带广告软件或不需要的工具栏,这些会随系统启动而运行。通过控制面板卸载不需要的软件并禁用自启动程序会有帮助。使用 Windows 安全中心进行彻底病毒扫描可以检测并删除恶意软件。最后,更新操作系统能确保笔记本获得最新的性能补丁。莎拉按照这些步骤操作后,电脑变得快多了。
2. Case 2: Sending Secret Messages with Binary | 案例二:用二进制发送秘密消息
Tom wants to send a secret message to his friend Alex without anyone else reading it. They decide to use binary code, the language of computers. Each letter is represented by a unique pattern of 0s and 1s. For example, the uppercase letter 'A' in ASCII is 01000001. Tom writes 'HELLO' in binary and wants Alex to decode it.
汤姆想给朋友亚历克斯发一条秘密消息,不让别人看懂。他们决定使用二进制,也就是计算机的语言。每个字母都由一串独特的 0 和 1 表示。例如,大写字母“A”在 ASCII 码中是 01000001。汤姆用二进制写下“HELLO”,并让亚历克斯解码。
The ASCII table is the key. Each character has a decimal value. 'H' is 72, which is 01001000 in 8-bit binary; 'E' is 69 → 01000101; 'L' is 76 → 01001100; 'O' is 79 → 01001111. So 'HELLO' convert binary to decimal first: 01001000₂ = 64+8 = 72, then find the according character.
ASCII 表是关键。每个字符有一个十进制数值。“H”是 72,即 8 位二进制 01001000;“E”是 69 → 01000101;“L”是 76 → 01001100;“O”是 79 → 01001111。于是“HELLO”变成了 01001000 01000101 01001100 01001100 01001111。汤姆发送这一串数字。亚历克斯可以查找每个 8 位块,或者先把二进制转为十进制:01001000₂ = 64+8 = 72,然后找出对应的字符。
This case shows how computers store text. All data inside a computer is binary. Practising encoding and decoding improves your understanding of data representation. You can also design your own simple cipher by shifting binary values – just be careful that both sender and receiver use the same rule.
这个案例展示了计算机如何存储文字。计算机内部的所有数据都是二进制的。练习编码和解码可以提高你对数据表示的理解。你还可以通过偏移二进制数值来设计简单的密码——只要确保发送方和接收方使用相同的规则即可。
3. Case 3: Planning a Maze Game with Computational Thinking | 案例三:用计算思维规划迷宫游戏
Maya wants to code a simple maze game in Scratch. The player uses arrow keys to move a cat sprite through a maze to reach a cake. She needs to plan the game before coding. Computational thinking helps her break the problem into smaller parts: decomposition, pattern recognition, abstraction and algorithm design.
玛雅想用 Scratch 编写一个简单迷宫游戏。玩家用方向键控制小猫角色穿过迷宫到达蛋糕。她需要在编程前做好规划。计算思维帮助她把问题分解成更小的部分:分解、模式识别、抽象和算法设计。
First, decomposition: Maya lists the main elements – sprite movement, maze walls, winning condition, and score. Pattern recognition: she sees that movement for all four arrow keys follows a similar pattern: change x or y by a certain amount, but check if touching the wall colour first. Abstraction: she ignores irrelevant details like background music or decoration and focuses on the core logic. Algorithm: she writes a set of instructions in pseudocode: “When right arrow pressed, if not touching black colour, change x by 5.” Repeat for other directions. When the cat touches the cake sprite, broadcast a win message and stop.
首先是分解:玛雅列出主要元素——角色移动、迷宫墙壁、获胜条件和分数。模式识别:她发现四个方向键的移动遵循相似的模式:改变 x 或 y 坐标一定数值,但首先检查是否碰到墙壁颜色。抽象:她忽略背景音乐、装饰等无关细节,聚焦核心逻辑。算法:她用伪代码写下一组指令:“当按下右箭头时,若没有碰到黑色,则 x 增加 5。”其他方向同理。当小猫碰到蛋糕角色时,广播胜利消息并停止。
By thinking computationally, Maya can turn a fun idea into a well-structured program. This approach works for any coding project, from games to mobile apps.
通过计算思维,玛雅将有趣的想法转变为结构清晰的程序。这种方法适用于任何编程项目,从游戏到手机应用程序。
4. Case 4: Staying Safe Online – Spotting a Phishing Email | 案例四:安全上网——识别钓鱼邮件
Jake receives an email that appears to come from his school. It says his account will be locked unless he clicks a link and enters his username and password. The message contains some spelling mistakes and the sender address ends with “@sch00l.com” instead of the official school domain. Jake is not sure what to do.
杰克收到一封看似来自学校的邮件。邮件说他的账号将被锁定,除非他点击链接并输入用户名和密码。消息中有几处拼写错误,发件人地址以“@sch00l.com”结尾,而不是学校的官方域名。杰克不确定该怎么办。
This is a typical phishing attempt – a cyber criminal tries to trick you into giving away sensitive information. The red flags are: urgent language, grammatical errors, suspicious sender address and a request for personal details. Real organisations never ask for passwords via email. Jake should not click the link. Instead, he should mark the email as spam, delete it, and inform a teacher or parent. He could also check the school’s official website or phone to verify.
这是一次典型的网络钓鱼(phishing)尝试——网络罪犯试图诱骗你交出敏感信息。危险信号包括:紧急的语气、语法错误、可疑的发件地址以及索要个人信息。真正的组织绝不会通过邮件索取密码。杰克不应该点击链接。相反,他应将该邮件标记为垃圾邮件、删除,并告知老师或家长。他也可以查看学校官网或打电话核实。
Good online safety habits include using strong unique passwords, enabling two-factor authentication, and avoiding public Wi‑Fi for logging into important accounts. Sharing too much personal information on social media also increases the risk. Always pause and think before you click.
良好的上网安全习惯包括:使用强且独一无二的密码、启用双重认证,以及避免在公共 Wi‑Fi 下登录重要账户。在社交媒体上过多分享个人信息也会增加风险。点击之前一定要停下来想一想。
5. Case 5: Organising a School Library Database | 案例五:整理学校图书馆数据库
The school librarian, Mr Adams, keeps a list of books in a spreadsheet. He has columns: Book ID, Title, Author, Genre and Copies Available. He wants to find all science fiction books with more than 2 copies, sorted by author name. The data is messy – some entries have spelling mistakes and duplicate records.
学校图书管理员亚当斯先生用电子表格记录图书。他的表格包含这些列:图书编号、书名、作者、类型和可用册数。他想找出所有可用册数超过 2 本的科幻小说,并按照作者姓名排序。数据有些混乱——有些条目存在拼写错误和重复记录。
This is a data management task. First, Mr Adams should clean the data: remove duplicates using the built-in tool, correct spelling in the Genre column so that “Scifi”, “Sci‑Fi” and “Science Fiction” all become a single standard term. Then he can apply a filter: select rows where Genre equals “Science Fiction” AND Copies > 2. After that, he sorts the filtered data by Author in ascending order (A to Z). This produces a neat list he can print.
这是一项数据管理任务。首先,亚当斯先生应该清理数据:用内置工具删除重复项,修正“类型”列中的拼写,比如“Scifi”、“Sci‑Fi”和“Science Fiction”全部统一为同一个标准名称。然后他可以应用筛选:选择“类型”等于“Science Fiction”且“可用册数”大于 2 的行。之后,他将筛选后的数据按“作者”升序排列(A 到 Z)。这样就得到了一份整洁的清单,可以打印出来。
Understanding how to structure and query data is a core skill. The librarian can also create simple charts to visualise which genres are most popular, helping him decide which books to buy next.
理解如何构建和查询数据是一项核心技能。管理员还可以创建简单的图表来直观展示哪些类型最受欢迎,从而帮助他决定下次购买什么书。
6. Case 6: The Broken School Network | 案例六:故障的学校网络
One morning, the computers in the school library cannot access the internet. The technician, Ms Lee, is asked to fix the problem. The computers show a message: “No Internet, secured.” Other devices connected to the same Wi‑Fi, like tablets in the lab next door, are working fine. Only the library devices are affected.
一天早上,学校图书馆的电脑无法访问互联网。技术员李老师被请来解决这个问题。电脑显示一条消息:“无法访问互联网,已连接。”连接到同一 Wi‑Fi 的其他设备,如隔壁实验室的平板电脑,都能正常工作。只有图书馆的设备受影响。
Network troubleshooting follows a logical sequence. Since the Wi‑Fi is up (other devices work), the problem is not with the internet connection itself. It could be a local switch or the library's wireless access point. Ms Lee checks the physical connections: the Ethernet cable from the access point to the wall socket was loose. She plugs it in securely, and the computers reconnect. If that had not worked, she would have checked IP settings using the command ipconfig (Windows) to see if the devices received valid IP addresses from the DHCP server.
网络故障排除遵循逻辑顺序。既然 Wi‑Fi 正常(其他设备能工作),问题就不是出在互联网连接本身。可能是本地交换机或图书馆的无线接入点出了故障。李老师检查物理连接:接入点到墙壁插座的网线松了。她将其插紧,电脑便重新连上了网。如果这样不行,她还会用 ipconfig 命令(Windows)检查 IP 设置,以确认设备是否从 DHCP 服务器获取到了有效 IP 地址。
This case reminds us that simple physical issues are often the cause. Knowing basic network commands and hardware components (router, switch, access point) is essential for diagnosing connectivity problems.
这个实例提醒我们,简单的物理问题往往是罪魁祸首。了解基本的网络命令和硬件组件(路由器、交换机、接入点),对诊断连接问题至关重要。
7. Case 7: Automating a Boring Task with a Script | 案例七:用脚本自动执行枯燥任务
Every week, Priya has to rename dozens of homework files from “document (1).pdf” to a format like “Maths_HW_Week5.pdf” a long time and is boring. She wonders if she can write a small program to automate this.
普里亚每周都要将几十份作业文件从“document (1).pdf”重命名为像“Maths_HW_Week5.pdf”这样的格式。这件事耗时又枯燥。她想知道能否写一个小程序来自动完成这项工作。
Yes, this is exactly what scripting is for. Priya can use Python with its built-in os module. The algorithm is: get a list of all files in the folder; for each file, check if it matches a pattern; then create a new name and rename. She defines mapping rules, e.g. if the original contains “Maths” and a number, extract that number and form the new name. A simple Python script:
没错,这正是脚本的用途。普里亚可以使用 Python 的内置 os 模块。算法是:获取文件夹中的所有文件列表;对每个文件,检查是否匹配某种模式;然后创建新文件名并重命名。她定义映射规则,例如如果原文件名包含“Maths”和一个数字,就提取该数字并组成新名称。一个简单的 Python 脚本:
import os
for filename in os.listdir('.'):
if 'Maths' in filename and filename.endswith('.pdf'):
new_name = 'Maths_HW_' + filename.split('(')[1].split(')')[0] + '.pdf'
os.rename(filename, new_name)
After testing on a copy of the files, Priya runs the script and saves hours of work. Automation reduces human error and frees up time for more creative tasks. Even a short program can make a big difference.
在对文件副本进行测试后,普里亚运行了脚本,节省了好几个小时。自动化能减少人为错误,并将时间解放出来用于更有创造性的任务。即使一个简短的程序也能带来巨大的改变。
8. Case 8: Spreadsheet Magic – Analysing Class Test Scores | 案例八:电子表格魔法——分析班级测验成绩
Mr Chen has a spreadsheet with students’ scores in three tests. He wants to calculate each student’s average, highlight any average below 50%, and draw a bar chart comparing the class average in each test. The data is in columns: Name, Test1, Test2, Test3.
陈老师有一张包含学生三次测验成绩的电子表格。他想计算每个学生的平均分,突出显示任何低于 50% 的平均分,并绘制一张柱状图来比较每次测验的全班平均分。数据列是:姓名、测验1、测验2、测验3。
He inserts a new column ‘ wn. For highlighting, conditional formatting is perfect: select the Average column, choose ‘Format cells if… using =AVERAGE(B2:B21) at the bottom of each test column, then selects the three summary figures and inserts a bar chart.
他插入一个新列“平均分”,并在第一个学生的行中使用公式 =AVERAGE(B2:D2),然后向下填充。对于突出显示,条件格式非常合适:选择“平均分”列,选择“当单元格值… 小于 50”,并设置红色填充。这会立刻显示哪些学生需要额外帮助。对于图表,他在每列测验数据下方用 =AVERAGE(B2:B21) 计算每次测验的整体平均分,然后选中这三个汇总数字并插入柱状图。
Spreadsheet skills like formulas, conditional formatting and charts are powerful tools for analysing information in any subject. They turn raw numbers into clear, actionable insights.
公式、条件格式和图表等电子表格技能,是分析任何学科信息的强大工具。它们能把原始数字转化为清晰、可用于行动的见解。
9. Case 9: How Computers Sort – Arranging Books on a Shelf | 案例九:计算机如何排序——摆放书架上的图书
The librarian asks two Year 7 students to sort a pile of ten books alphabetically by author surname. They decide to use a method like bubble sort, which they learned in computing class. They compare the first two books; if the second one’s author comes earlier in the alphabet, they swap them. They continue down the pile, repeating passes until no swaps are needed.
图书管理员请两名七年级学生将一摞十本书按作者姓氏字母顺序排列。他们决定采用计算课上学过的冒泡排序法。他们比较前两本书;如果第二本书的作者在字母表中更靠前,就把它们交换位置。然后他们继续沿着书堆比较,重复多轮,直到不再需要交换。
This simple algorithm works even if the books are completely shuffled. The process can be written in pseudocode: “Repeat for i from 1 to n-1; for j from 0 to n-i-1; if item[j] > item[j+1], swap.” Understanding sorting helps students appreciate how computers organise large datasets quickly. Bubble sort is easy to visualise, but for big lists, more efficient algorithms like merge sort are used.
即使书完全打乱了,这个简单的算法也能奏效。可以用伪代码写出这个过程:“重复 i 从 1 到 n-1;j 从 0 到 n-i-1;如果 item[j] > item[j+1],则交换。”理解排序有助于学生体会计算机如何快速整理大型数据集。冒泡排序容易可视化,但对于大列表,会采用归并排序等更高效的算法。
Manual sorting with books also reinforces the idea that an algorithm is just a set of step-by-step instructions that anyone – or any machine – can follow.
用书手动排序也强化了一个概念:算法就是一组逐步执行的指令,任何人——或任何机器——都可以遵循。
10. Case 10: An Ethical Dilemma in the Computer Lab | 案例十:计算机实验室里的道德困境
During a coding project, Nina notices that her classmate Leo has copied another student’s Scratch game and submitted it as his own. He changed only the costumes. Nina remembers the school’s academic honesty policy and feels uncomfortable. She is unsure whether to tell the teacher or stay silent.
在一次编程项目中,尼娜发现同学利奥抄袭了另一个学生的 Scratch 游戏并当作自己的作业提交。他只改换了造型。尼娜记得学校的学术诚信政策,感到不安。她不确定是应该告诉老师还是保持沉默。
This is an ethical decision. Computing has rules about intellectual property and respect for others’ work. Passing off someone else’s code as your own is a form of plagiarism. Nina could first speak to Leo privately, reminding him that it’s unfair and could lead to serious consequences. If he does not take responsibility, she should inform the teacher – not to get him into trouble, but to uphold fairness. The teacher can then guide Leo to produce his own original work.
这是一个道德抉择。计算领域涉及知识产权和尊重他人劳动成果的规则。将他人的代码冒充为自己编写是一种剽窃行为。尼娜可以先私下跟利奥谈谈,提醒他这样做不公平,可能会带来严重后果。如果他拒不承担责任,她应该告诉老师——不是为了让他受罚,而是为了维护公平。老师然后可以引导利奥完成自己的原创作品。
Thinking about ethics helps build a responsible digital citizen. Whether it is respecting copyright, keeping passwords private or standing up against cheating, making the right choice matters both online and offline.
思考道德问题有助于培养负责任的数字公民。无论是尊重版权、保护密码隐私,还是抵制作弊,做出正确选择在线上和线下都很重要。
Published by TutorHao | Computer Science Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)

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