Egypt › Secondary › First Secondary Grade › Programming and Artificial Intelligence › Unit ١٢: Programming

Lesson ١: Algorithms

First Secondary GradeProgramming and Artificial IntelligenceSecond Termالدرس ١٣٠ دقيقة

فيديو الشرح

الفيديو قيد الإنتاج، وسيظهر هنا فور اعتماده.

ماذا ستتعلم؟

اختبر استعدادك أولًا

١. In the question "What is an algorithm?" the options are: ١) An ordered set of clear steps that solves a problem ٢) A computer brand ٣) A type of screen ٤) A random guess. What is the number of the correct answer?
٢. In the question "Give a daily-life example of an algorithm." the options are: ١) A painting ٢) A tea recipe with ordered steps ٣) A song without order ٤) A dream. What is the number of the correct answer?
٣. In the question "What is a flowchart?" the options are: ١) A river map ٢) A photo editor ٣) A drawing of an algorithm using boxes and arrows ٤) A keyboard type. What is the number of the correct answer?

الشرح خطوة بخطوة

Level ١: We explore together

Lesson topic: Algorithms. Before writing any program, a programmer writes the steps of the solution in a clear order.

The story: An algorithm is an ordered set of clear steps that solves a problem or finishes a task. A recipe for tea is an algorithm: boil water, add tea, add sugar, stir, pour into a cup. We can write an algorithm as numbered steps in normal language, or draw it as a flowchart with boxes and arrows. A good algorithm is clear, ordered, finite, and gives the correct result for every valid input. In this lesson we learn what an algorithm is and how to describe one with steps and flowcharts.

أخطاء شائعة وتصحيحها

أمثلة محلولة متدرجة

Easy · مثال ١

Define an algorithm.

  1. نقرأ السؤال معًا بهدوء.
  2. Ordered clear steps.
الإجابة: An ordered set of clear steps that solves a problem or finishes a task
Easy · مثال ٢

What shape is used for decisions in a flowchart?

  1. نقرأ السؤال معًا بهدوء.
  2. Four sides, pointed.
الإجابة: A diamond
Easy · مثال ٣

Name two properties of a good algorithm.

  1. نقرأ السؤال معًا بهدوء.
  2. Clear, ordered, finite, correct.
الإجابة: Clear and finite (also ordered and correct)
Medium · مثال ٤

Write an algorithm of four steps for brushing your teeth.

  1. نقرأ السؤال معًا بهدوء.
  2. Order matters.
الإجابة: Example: open the toothpaste; put paste on the brush; brush all teeth for two minutes; rinse the mouth and the brush
Medium · مثال ٥

Why is "add some sugar" a weak algorithm step? How do you fix it?

  1. نقرأ السؤال معًا بهدوء.
  2. Make it measurable.
الإجابة: Because "some" is unclear; fix it with an exact amount like "add one spoon of sugar"
Medium · مثال ٦

Draw with words a flowchart for: if it rains, take an umbrella, else wear sunglasses.

  1. نقرأ السؤال معًا بهدوء.
  2. Start, decision, two branches.
الإجابة: Start -> decision diamond "is it raining?" -> yes branch: take an umbrella -> end; no branch: wear sunglasses -> end
Medium · مثال ٧

Why do programmers write the algorithm before the code?

  1. نقرأ السؤال معًا بهدوء.
  2. Plan first, build second.
الإجابة: Because the algorithm makes the logic clear and catches mistakes early, before the harder work of coding
Advanced · مثال ٨

Write an algorithm that finds the largest of three numbers, step by step.

  1. نقرأ السؤال معًا بهدوء.
  2. Compare pairs.
الإجابة: Example: read the three numbers; assume the first is the largest; if the second is larger, make it the largest; if the third is larger, make it the largest; print the largest
Error analysis · مثال ٩

Your friend says: "An algorithm can go on forever." Is this correct?

  1. نقرأ السؤال معًا بهدوء.
  2. What does finite mean?
الإجابة: Wrong, an algorithm must be finite and end after a limited number of steps

الخريطة الذهنية

AlgorithmsUnit ١٢: Programming
▼
An ordered set of clear steps that solves a problemWhat is an algorithm?
A tea recipe with ordered stepsGive a daily-life example of an algorithm.
A drawing of an algorithm using boxes and arrowsFrom the lesson questions
A diamond with a yes/no questionWhat does a decision box in a flowchart look like?

إنفوجرافيك: Lesson map: words of the day

Lesson map: words of the day
اضغط على أي صف لترى الفكرة.
The key ideas of the lesson in order
We review the questions after one day, then after three days

تدريبات متنوعة مع الإجابات والتفسير

اكتب الإجابة أو اختر ثم اضغط. بعد كل سؤال يظهر الحل مع التفسير.

A) I choose the answer

١. The answer "Writing the code first" to the question "Which comes first: writing the algorithm or writing the code?" is correct.
٢. The answer "Because changing the order can change the result" to the question "Why must algorithm steps be ordered?" is correct.
٣. The answer "A dream" to the question "Give a daily-life example of an algorithm." is correct.
٤. The answer "They are the same thing" to the question "Which comes first: writing the algorithm or writing the code?" is correct.
٥. From the lesson explanation: Is "make it tasty" a good algorithm step? Why not?
٦. The answer "Nothing" to the question "In a flowchart, what do arrows show?" is correct.
٧. Which question has the answer "A drawing of an algorithm using boxes and arrows"?
٨. The answer "A computer brand" to the question "What is an algorithm?" is correct.

B) I practice and answer

١. The answer "A keyboard type" to the question "What is a flowchart?" is correct.
٢. The answer "It is random" to the question "Name one property of a good algorithm." is correct.
٣. Which question has the answer "Because changing the order can change the result"?
٤. Which question has the answer "A tea recipe with ordered steps"?
٥. The answer "Order does not matter" to the question "Why must algorithm steps be ordered?" is correct.
٦. The answer "A painting" to the question "Give a daily-life example of an algorithm." is correct.
٧. Which question has the answer "A diamond with a yes/no question"?
٨. The answer "An ordered set of clear steps that solves a problem" to the question "What is an algorithm?" is correct.

C) I review and play

١. The answer "Colors only" to the question "In a flowchart, what do arrows show?" is correct.
٢. The answer "It has no start" to the question "What does finite mean for an algorithm?" is correct.
٣. The answer "A tea recipe with ordered steps" to the question "Give a daily-life example of an algorithm." is correct.
٤. The answer "A type of screen" to the question "What is an algorithm?" is correct.
٥. From the lesson explanation: A good algorithm is clear, ordered, finite, and gives the correct result for every valid input.
٦. From the lesson explanation: Why must algorithm steps be ordered?
٧. The answer "To slow computers" to the question "Why must algorithm steps be ordered?" is correct.
٨. The answer "A drawing of an algorithm using boxes and arrows" to the question "What is a flowchart?" is correct.

ملخص صوتي وقارئ الدرس

قارئ تجريبي يعمل بصوت جهازك (مجاني). ليس تسجيلًا احترافيًا، وجودة الصوت العربي تختلف من جهاز لآخر. التسجيل الصوتي الاحترافي لم يُنتج بعد.

Lesson topic: Algorithms. Before writing any program, a programmer writes the steps of the solution in a clear order.

We review the key points of the lesson: What is an algorithm? -> An ordered set of clear steps that solves a problem; Give a daily-life example of an algorithm. -> A tea recipe with ordered steps.

We apply what we learned by answering these questions: What is an algorithm? -> An ordered set of clear steps that solves a problem; Give a daily-life example of an algorithm. -> A tea recipe with ordered steps; What is a flowchart? -> A drawing of an algorithm using boxes and arrows.

مسار المراجعة للامتحان

  1. Day one (١٠ minutes): We read levels ١ to ٣ together, then solve exercises (A).
  2. Day two (١٠ minutes): We play the level ٤ games and solve exercises (B).
  3. Day three (١٠ minutes): Exercises (C), then the Level One test.
  4. Before the school exam: We repeat the Level Three test and look at the common mistakes.

اختبارات بثلاثة مستويات

Level One Test: The Basics

٨ أسئلة. اجب ثم اضغط «أنهِ الاختبار» لترى درجتك.

١. Which question has the answer "An ordered set of clear steps that solves a problem"?
٢. The answer "Only on Mondays" to the question "Is "make it tasty" a good algorithm step? Why not?" is correct.
٣. The answer "A cloud" to the question "What does a decision box in a flowchart look like?" is correct.
٤. From the lesson explanation: An algorithm is an ordered set of clear steps that solves a problem or finishes a task.
٥. From the lesson explanation: What is an algorithm?
٦. From the lesson explanation: We can write an algorithm as numbered steps in normal language, or draw it as a flowchart with boxes and arrows.
٧. The answer "A song without order" to the question "Give a daily-life example of an algorithm." is correct.
٨. The answer "It runs forever" to the question "What does finite mean for an algorithm?" is correct.

المصادر والحقوق

رمز QR هذه الصفحة. يفتح درس «Lesson ١: Algorithms» نفسه.