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

Lesson ٢: Programming Basics ١

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

فيديو الشرح

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

ماذا ستتعلم؟

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

١. In the question "What is a variable?" the options are: ١) A named storage place that holds a value which can change ٢) A fixed number forever ٣) A screen part ٤) A cable. What is the number of the correct answer?
٢. In the question "Give an example of a variable name and value." the options are: ١) ٩٥ = score ٢) score = ٩٥ ٣) score score ٤) == ٩٥. What is the number of the correct answer?
٣. In the question "What is a data type?" the options are: ١) The color of text ٢) The screen size ٣) The kind of value a variable holds, like number or text ٤) The keyboard brand. What is the number of the correct answer?

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

Level ١: We explore together

Lesson topic: Programming Basics ١. Programming is writing instructions that a computer follows exactly to solve problems.

The story: A program stores data in variables, which are named boxes that hold values and can change. Data comes in types: numbers for calculations, text for words, and true/false values for decisions. Programs take input from the user, process it, and show output on the screen. We use conditions like if to make the program choose between different paths. In this lesson we learn about variables, data types, input, output and simple conditions.

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

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

Easy · مثال ١

What is a variable?

  1. نقرأ السؤال معًا بهدوء.
  2. A named box for a value.
الإجابة: A named storage place that holds a value which can change
Easy · مثال ٢

Choose the right data type for: ١٧, "Ahmed", True.

  1. نقرأ السؤال معًا بهدوء.
  2. Number, text, ...
الإجابة: ١٧ is a number, "Ahmed" is text, True is a true/false (boolean) value
Easy · مثال ٣

What is the difference between input and output?

  1. نقرأ السؤال معًا بهدوء.
  2. In versus out.
الإجابة: Input is data the program receives, output is the result the program shows
Medium · مثال ٤

Write a tiny program in words: ask for a name and say hello to it.

  1. نقرأ السؤال معًا بهدوء.
  2. Input then output.
الإجابة: Input: ask the user for their name and store it in a variable; output: print hello followed by the name
Medium · مثال ٥

Explain why score = ٩٥ stores ٩٥ on the right inside score on the left, not the opposite.

  1. نقرأ السؤال معًا بهدوء.
  2. Name holds value.
الإجابة: Because the variable name is the container and the value is what we put inside it; flipping them is meaningless
Medium · مثال ٦

Write a condition in words: a student passes if the grade is ٥٠ or more.

  1. نقرأ السؤال معًا بهدوء.
  2. If, test, action, else.
الإجابة: If grade is greater than or equal to ٥٠ print pass, otherwise print fail
Medium · مثال ٧

A program asks for age and the user types "twelve". What problem appears?

  1. نقرأ السؤال معًا بهدوء.
  2. Type mismatch.
الإجابة: The input is text, not a number, so calculations on age fail; the program should expect a numeric type
Advanced · مثال ٨

Design in words a program that reads a temperature and prints cold, warm or hot with your own limits.

  1. نقرأ السؤال معًا بهدوء.
  2. Two conditions.
الإجابة: Example: input temperature; if it is below ١٥ print cold; else if it is below ٣٠ print warm; otherwise print hot
Error analysis · مثال ٩

Your friend says: "A variable keeps its first value forever." Is this correct?

  1. نقرأ السؤال معًا بهدوء.
  2. What does vary mean?
الإجابة: Wrong, a variable can change its value while the program runs

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

Programming Basics ١Unit ١٢: Programming
▼
A named storage place that holds a value which can changeWhat is a variable?
score = ٩٥Give an example of a variable name and value.
The kind of value a variable holds, like number or textFrom the lesson questions
A number typeWhich type fits the value ٢٥?

إنفوجرافيك: 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 "It repeats forever" to the question "What does an if condition do?" is correct.
٢. The answer "٩٥ = score" to the question "Give an example of a variable name and value." is correct.
٣. The answer "A sound type" to the question "Which type fits the value ٢٥?" is correct.
٤. The answer "A date type" to the question "Which type fits the value "Mona"?" is correct.
٥. The answer "A text (string) type" to the question "Which type fits the value "Mona"?" is correct.
٦. The answer "A screen part" to the question "What is a variable?" is correct.
٧. The answer "It makes the program choose a path based on a test" to the question "What does an if condition do?" is correct.
٨. Which question has the answer "A number type"?

B) I practice and answer

١. Which question has the answer "score = ٩٥"?
٢. The answer "The color of text" to the question "What is a data type?" is correct.
٣. The answer "Data the program receives from the user or a device" to the question "What is input in a program?" is correct.
٤. The answer "The battery" to the question "What is output?" is correct.
٥. The answer "The kind of value a variable holds, like number or text" to the question "What is a data type?" is correct.
٦. The answer "Because output comes first" to the question "Why do programs process input before output?" is correct.
٧. The answer "Because the output depends on processing the input" to the question "Why do programs process input before output?" is correct.
٨. The answer "score = ٩٥" to the question "Give an example of a variable name and value." is correct.

C) I review and play

١. From the lesson explanation: Which type fits the value "Mona"?
٢. The answer "A fail message" to the question "Complete: if score >= ٥٠ then print ...?" is correct.
٣. The answer "To save battery" to the question "Why do programs process input before output?" is correct.
٤. The answer "The keyboard brand" to the question "What is a data type?" is correct.
٥. The answer "The result the program shows or sends out" to the question "What is output?" is correct.
٦. From the lesson explanation: What is output?
٧. The answer "== ٩٥" to the question "Give an example of a variable name and value." is correct.
٨. The answer "A cable" to the question "What is a variable?" is correct.

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

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

Lesson topic: Programming Basics ١. Programming is writing instructions that a computer follows exactly to solve problems.

We review the key points of the lesson: What is a variable? -> A named storage place that holds a value which can change; Give an example of a variable name and value. -> score = ٩٥.

We apply what we learned by answering these questions: What is a variable? -> A named storage place that holds a value which can change; Give an example of a variable name and value. -> score = ٩٥; What is a data type? -> The kind of value a variable holds, like number or text.

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

  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

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

١. From the lesson explanation: We use conditions like if to make the program choose between different paths.
٢. The answer "Data typed in" to the question "What is output?" is correct.
٣. Which question has the answer "Because the output depends on processing the input"?
٤. Which question has the answer "The kind of value a variable holds, like number or text"?
٥. Which question has the answer "A pass message"?
٦. The answer "A text type" to the question "Which type fits the value ٢٥?" is correct.
٧. The answer "The desk" to the question "What is output?" is correct.
٨. From the lesson explanation: Why do programs process input before output?

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

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