베타이 플랫폼은 활발히 개발 중이에요; 버그, 미완성 기능, 데이터 손실 위험이 있어요. 응원해 주셔서 감사해요!

Algorithms

플레이하며 배우기

이 문제들을 풀어 에너지를 얻은 뒤 낚시하고 탐험하세요. 계정이 필요 없어요.

선생님을 위해: Algorithms(Computer Science, CIE)을(를) 위한 바로 쓸 수 있는 수업 슬라이드, 복습 노트 — 수업에 사용하거나, 학생들이 실시간 게임으로 즐기는 인터랙티브 클래스 활동으로 진행하세요.

수업 노트

What is an Algorithm?

  • An algorithm is a precise set of rules or instructions to solve a specific problem or task.
  • Algorithms can be designed using structure diagrams, flowcharts, or pseudocode.
  • A well-designed algorithm should be interpretable by a new user to explain its purpose.

Structure Diagrams

  • Structure diagrams show hierarchical top-down design in a visual form.
  • Each problem is divided into sub-problems, and each sub-problem is further divided.
  • At each level, the problem is broken down into more detailed tasks that can be implemented using a single subroutine.
  • Example: A mobile app structure diagram might show top-level modules like 'Login', 'Main Menu', and 'Settings', each with sub-tasks.

Flowcharts

  • Flowcharts use shapes to represent different functions (e.g., process, decision, input/output).
  • Lines show the flow of control between steps.
  • Common shapes: oval (start/end), rectangle (process), diamond (decision), parallelogram (input/output).
  • Example: A flowchart for age verification inputs age, checks if ≥18, and outputs appropriate message.

Pseudocode

  • Pseudocode is a text-based tool using short English words/statements to describe an algorithm.
  • It is more structured than plain English but very flexible.
  • Use INPUT and OUTPUT statements (not `print()` or `input()` with brackets).
  • Example: `INPUT Age` / `IF Age ≥ 18 THEN OUTPUT "Welcome"`.
  • Default to pseudocode when writing algorithms; use flowcharts only when asked.

Explaining Algorithms

  • To explain an algorithm, follow the instructions step by step to determine its purpose.
  • Look for comments in the code, consider the context, and test with different inputs.
  • The algorithm's purpose should become clear by tracing its logic.
  • Example: A REPEAT loop that inputs 10 numbers and outputs the total adds ten user-entered numbers.

Worked Example: Grade Assignment

  • Input marks are stored in an array `Score[]`.
  • Each mark is checked against boundaries (70, 60, 50, 40, 30) to assign a grade (A–F).
  • The grade is stored in `Grade[]` at the same index as the mark.
  • The algorithm repeats until 30 marks have been input and processed.

슬라이드

Sign up free to view the lesson slides

Step through every slide for this topic — plus flashcards and revision notes — with a free account.

연습 문제

무료 미리 보기 — 52개 중 8개 문제. 가입하면 전부 볼 수 있어요.
  1. 1.What is an algorithm?

    Easy
    • AA precise set of rules or instructions to solve a specific problem
    • BA type of computer hardware
    • CA programming language
    • DA data structure
  2. 2.Which of the following is NOT a method for designing an algorithm?

    Easy
    • AStructure diagrams
    • BFlowcharts
    • CPseudocode
    • DBinary search
  3. 3.In a flowchart, which shape is used to represent a decision?

    Easy
    • ARectangle
    • BDiamond
    • COval
    • DParallelogram
  4. 4.What does a structure diagram show?

    Easy
    • AThe flow of control through an algorithm
    • BHierarchical top-down design, breaking a problem into sub-problems
    • CThe exact syntax of a programming language
    • DThe data types used in a program
  5. 5.In pseudocode, which of the following is the correct way to output a message?

    Easy
    • AOUTPUT 'Hello'
    • Bprint('Hello')
    • CPRINT 'Hello'
    • DDISPLAY 'Hello'
  6. 6.Consider the following pseudocode: Count ← 1 Total ← 0 REPEAT INPUT Number Total ← Total + Number Count ← Count + 1 UNTIL Count > 10 OUTPUT Total What does this algorithm do?

    Medium
    • AIt outputs the sum of ten numbers entered by the user
    • BIt outputs the average of ten numbers entered by the user
    • CIt outputs the largest of ten numbers entered by the user
    • DIt outputs the count of numbers entered
  7. 7.In the following pseudocode, what is stored in Grade[2] if the input Score[2] is 65? Count ← 0 REPEAT INPUT Score[Count] IF Score[Count] ≥ 70 THEN Grade[Count] ← 'A' ELSE IF Score[Count] ≥ 60 THEN Grade[Count] ← 'B' ELSE IF Score[Count] ≥ 50 THEN Grade[Count] ← 'C' ELSE IF Score[Count] ≥ 40 THEN Grade[Count] ← 'D' ELSE IF Score[Count] ≥ 30 THEN Grade[Count] ← 'E' ELSE Grade[Count] ← 'F' ENDIF ENDIF ENDIF ENDIF ENDIF Count ← Count + 1 UNTIL Count = 30

    Medium
    • A'B'
    • B'A'
    • C'C'
    • D'D'
  8. 8.Which of the following is a characteristic of pseudocode?

    Easy
    • AIt uses strict syntax like a programming language
    • BIt is a visual tool using shapes
    • CIt uses short English words/statements to describe an algorithm
    • DIt is written in binary

Unlock all 52 questions & more

무료 계정을 만들어 이 주제의 모든 문제, 슬라이드, 플래시카드, 복습 노트를 확인하세요.

기출 문제

이 주제의 기출 문제 연습이 곧 나와요.
곧 출시