Program Function and Purpose
도입됨
6:10
창작적 개발
두 수의 평균을 출력해야 하는 프로그램이 있습니다. 실행됩니다. 충돌하지 않습니다. 답을 출력하지만 답은 틀립니다.给它四和六(Give it four and six—주어진 텍스트는 영어로 되어 있으므로 번역: 네와 여섯을 주면)…
영어 내레이션 · 영어와 중국어 자막 전환 가능
이 수업의 내용
| English | 의미 |
|---|---|
| purpose/ˈpɜːpəs/ | 목적 |
| function/ˈfʌŋkʃn/ | 기능 |
| behavior/bɪˈheɪvjə/ | 행동 |
| Input/ˈɪnpʊt/ | 입력 |
| Processing/ˈprəʊsesɪŋ/ | 처리 |
| Output/ˈaʊtpʊt/ | 출력 |
| events/ɪˈvents/ | 이벤트 |
| event-driven/ɪˈvent ˈdrɪvən/ | 이벤트 기반 |
| event handler/ɪˈvent ˈhændlə/ | 이벤트 핸들러 |
목적 vs 기능
- 코드를 쓰기 전에 서로 관련된 두 가지 개념을 명확히 하십시오.
- 프로그램의 목적은 그것이 존재하는 이유 — 해결하려는 문제입니다.
- 기능은 그것이 무엇을 하는지 — 사용자가 보는 행동입니다.
- 날씨 앱의 목적은 "사람들이 계획할 수 있도록 돕는 것"; 기능은 "예보를 표시하는 것"입니다.
Input, processing, or output?
Every program takes input, processes it by its instructions, and produces output. Sort each part of a program into the right stage.
A program's purpose is why it exists; its function is:
난이도 1/5 · 100코인 + 오늘 첫 완료 시 작은 보너스 추가
Purpose = the goal; function = the visible behavior that reaches it.
Which is an example of input?
난이도 1/5 · 100코인 + 오늘 첫 완료 시 작은 보너스 추가
A tap is data the program receives; the others are outputs.
입력 → 처리 → 출력 모델
- 모든 프로그램은 간단한 모델을 따릅니다: 입력 → 처리 → 출력 (IPO 모델).
- 입력: 프로그램이 받는 데이터 — 타이핑, 센서, 파일, 인터넷.
- 처리: 그 입력에 수행하는 단계들입니다.
- 출력: 결과 — 텍스트, 소리, 저장된 파일, 움직이는 로봇.

모든 프로그램은 입력, 처리, 출력으로 분해됩니다

Put the IPO model in order.
난이도 3/5 · 200코인 + 오늘 첫 완료 시 작은 보너스 추가
Data comes in, is processed, and a result goes out.
A program that waits and reacts to clicks and key presses is ______-driven.
난이도 1/5 · 100코인 + 오늘 첫 완료 시 작은 보너스 추가
Each event triggers an event handler.
A program always gives the same output, whatever input it receives.
난이도 1/5 · 100코인 + 오늘 첫 완료 시 작은 보너스 추가
False. A program's behavior is how it responds to input, so different inputs can give different outputs.
행동과 이벤트
- 프로그램의 행동은 입력에 어떻게 반응하는지입니다 — 다른 입력은 다른 출력을 줄 수 있습니다.
- 현대적 프로그램의 많은 부분은 이벤트 지향입니다: 클릭이나 키 누름과 같은 이벤트를 기다리고 반응합니다.
- 각 이벤트는 이벤트 핸들러라고 불리는 작은 코드 조각을 트리거합니다.
- 게임, 웹사이트 버튼, 채팅 앱은 모두 이벤트 지향입니다.
A well-designed program should: (Select all that apply)
난이도 2/5 · 140코인 + 오늘 첫 완료 시 작은 보너스 추가
Good design also handles every possible input, including unusual ones.
잘 설계된 프로그램이 하는 일
- 사용자를 위해 진짜 문제를 해결합니다.
- 기대하는 입력과 제공하는 출력이 명확합니다.
- 실행될 때마다 안정적으로 업무를 수행합니다.
- 모든 가능한 입력을 생각하는 것이 올바른 설계의 일부입니다.
이 카드는 새로 추가되어 번역이 준비될 때까지 영어로 표시됩니다.
Worked example: a step-counter app
A step-counter app helps people stay active. It reads the phone's motion sensor, counts each step, and shows the day's total; when the user taps "Reset", the count goes back to zero. Identify its purpose, function, input, processing, output and an event.
- Purpose: help people stay active. Function: count and display steps. Input: motion sensor data and taps on the screen.
- Processing: detect a step pattern in the sensor data and add 1 to the count. Output: the step total on screen. Event: tapping "Reset" triggers its event handler 事件处理程序, which sets the count to 0.
In a calculator app, the user typing "7 × 6" is the:
난이도 1/5 · 100코인 + 오늘 첫 완료 시 작은 보너스 추가
It is data given to the program.
In an event-driven program, code runs in response to actions such as a click or key press.
난이도 1/5 · 100코인 + 오늘 첫 완료 시 작은 보너스 추가
Each event triggers its handler.
프로그램의 목적은 그것이 존재하는 이유이며, 기능은 그것이 하는 일입니다. 모든 프로그램은 입력 → 처리 → 출력(IPO 모델)에 맞습니다. 그 행동은 입력에 어떻게 반응하는지이며, 많은 프로그램은 이벤트 지향으로, 이벤트 핸들러를 통해 클릭과 키 누름에 반응합니다.
어떤 문제가 있었나요? 사이트 팀만 이 내용을 볼 수 있습니다.