Print or save as PDF — A4, margins already set. If your browser still adds a date or a file path, switch off “Headers and footers” in the print dialog.
Foundation Session — Introduction to Programming & Artificial Intelligence

How Does a Computer Think… and How Does a Programmer Think?

Student Booklet

Introduction: This Course Is for You

This course works for you even if your level is "below zero" in programming. You don't need advanced maths or English — the basics are enough. And you don't need a powerful computer; a phone or tablet is fine to start with. The goal is to build a strong foundation together, so you can choose your path (computer science, artificial intelligence…) with confidence.

الكورس ده مناسب ليك حتى لو مستواك تحت الصفر. مش محتاج رياضيات أو إنجليزي متقدم، ومش محتاج جهاز قوي — الموبايل كفاية للبداية.

1 · How Does a Computer Work?

A computer is a "dumb" machine — it does exactly what you tell it, nothing more and nothing less. To understand how it works, you need to know it goes through three main stages:

1

Input

Receiving data from the user, such as typing on a keyboard

المدخلات: استقبال البيانات من المستخدم، زي الكتابة على لوحة المفاتيح

2

Processing

Processing that data using the Central Processing Unit (CPU)

المعالجة: معالجة البيانات دي عن طريق وحدة المعالجة المركزية

3

Output

Showing the final result to the user

المخرجات: إظهار النتيجة النهائية للمستخدم

الكمبيوتر جهاز "غبي" — بينفذ اللي بتقوله له حرفيًا. وبيمر بثلاث مراحل أساسية.

Prepared by: Mr. Eissa Islam

Practical Examples

ExampleInputProcessingOutput
Calculator3 and 5 Addition8
ATM machineCard and amount Checking balance and detailsCash comes out
Facebook loginUsername and password Matching them against the databaseAccount opens

A quick way to tell them apart: input is what you hand the machine, processing is the work happening inside where you cannot see it, and output is what it hands back to you.

طريقة سريعة تعرف بيها أي مرحلة: المدخلات هي اللي انت بتديها للجهاز، والمعالجة هي الشغل اللي بيحصل جواه ومش شايفه، والمخرجات هي اللي بيرجعهولك.

2 · Key Programming Terms

Four terms often get mixed up — here's the difference:

Programming

The art of thinking and solving problems step by step, giving the computer specific, ordered instructions to carry out a task.

البرمجة: فن التفكير وحل المشكلات خطوة بخطوة، وإعطاء الكمبيوتر تعليمات محددة ومرتبة

Artificial Intelligence (AI)

Making the computer learn from data so it can work out solutions or make decisions itself by recognising patterns (like weather prediction, or ChatGPT).

الذكاء الاصطناعي: جعل الكمبيوتر يتعلم من البيانات ويستنتج الحلول بنفسه من خلال التعرف على الأنماط

Programming Language

The "medium" we use to write the steps for the computer (such as Python, C++, JavaScript).

لغة البرمجة: الوسيط اللي بنستخدمه عشان نكتب الخطوات للكمبيوتر

Source Code

The actual text a programmer writes in a programming language (for example: print("hello world")).

الكود المصدري: النص الفعلي اللي بيكتبه المبرمج بلغة البرمجة

Prepared by: Mr. Eissa Islam

Same Task, Two Different Approaches

Say you want a program that decides whether a photo shows a cat. Here is how each approach handles it:

ProgrammingArtificial Intelligence
Who works out the rules? You do. You write them yourself The computer does, from examples
What you give it "If it has pointed ears and whiskers, say cat" 10,000 photos already labelled cat or not cat
Result on a new photo Follows your rule exactly, every time Makes its best guess from the pattern it learned
Can it be wrong? Only if your rule was wrong Yes — it guesses, so it sometimes misses

نفس المهمة بطريقتين: في البرمجة انت اللي بتكتب القاعدة بنفسك، وفي الذكاء الاصطناعي الكمبيوتر بيستنتج القاعدة من آلاف الأمثلة — عشان كده الذكاء الاصطناعي ممكن يغلط، والبرمجة بتنفذ قاعدتك حرفيًا.

Language vs. Code — the Short Version

A programming language is like English or Arabic. Source code is like an actual sentence written in it. Python is the language; print("hello") is the code.

لغة البرمجة زي اللغة العربية نفسها، والكود المصدري زي جملة مكتوبة بيها. بايثون هي اللغة، و print("hello") هي الكود.

Prepared by: Mr. Eissa Islam

3 · A Programmer's Tools (The Kitchen Analogy)

A computer doesn't understand programming languages directly — it only understands zeros and ones. So we need tools to help us:

Text Editor — the kitchen counter

A simple program for writing code only (such as Notepad or Sublime Text) — like the counter where you prepare the ingredients. It cannot run anything.

محرر النصوص: برنامج بسيط لكتابة الأكواد بس — زي طاولة المطبخ اللي بنجهز عليها المكونات

Compiler — the oven

A program that converts the code we wrote into "machine language" (made of zeros and ones) so the computer can understand it.

المترجم: برنامج بيحوّل الكود اللي كتبناه إلى "لغة الآلة" (أصفار وواحدات) عشان يفهمها الكمبيوتر

IDE — Integrated Development Environment — the whole kitchen

A complete workshop for the programmer, containing a text editor, tools to run the program, and tools to find and fix errors — counter, fridge and oven included.

بيئة التطوير المتكاملة: ورشة عمل كاملة فيها محرر نصوص وأدوات تشغيل واكتشاف أخطاء — زي المطبخ بالكامل

Text Editor vs. Compiler vs. IDE — in One Example

You want to write a program that prints your name. Follow what each tool does:

ToolWhat it actually doesIn this example
Text editor
Notepad, Sublime Text
Lets you type and save the code. Nothing more — it cannot run anything You type print("Eissa") and save the file
Compiler Translates that saved code into machine language so the computer can execute it Turns your line into the zeros and ones the processor reads
IDE
PyCharm, Visual Studio
Bundles the editor, the compiler and error-finding tools into one program You type, press one button, and see Eissa appear — all in the same window

محرر النصوص بيكتب الكود بس ومش بيشغّله. المترجم بيحوّل الكود للغة الآلة. وبيئة التطوير (IDE) بتجمع الاتنين مع أدوات كشف الأخطاء في برنامج واحد.

Prepared by: Mr. Eissa Islam

The quickest way to keep them apart: a text editor writes, a compiler translates, an IDE does both plus finds your mistakes. An IDE is not a fourth kind of tool — it is the other tools packaged together.

أسرع طريقة تفرّق بينهم: محرر النصوص بيكتب، والمترجم بيترجم، والـIDE بيعمل الاتنين وكمان بيكشفلك الأخطاء. الـIDE مش أداة رابعة، هو الأدوات دي كلها مجمّعة مع بعض.

4 · The Programmer Mindset

The difference between a professional programmer and everyone else isn't typing speed — it's how they think about solving problems:

HabitWhat it looks like
Analysing the problem Breaking a big problem down into small parts

تحليل المشكلة: تقسيم المشكلة الكبيرة إلى أجزاء صغيرة

Logical thinking Looking for alternative solutions when the code doesn't work the first time

التفكير المنطقي: البحث عن حلول بديلة لما الكود ميشتغلش من أول مرة

Research and continuous learning Programming isn't learned in two months — it needs constant searching (like looking up fixes for errors)

البحث والتعلم المستمر: البرمجة مش بتتعلم في شهرين، محتاجة بحث دايم

Patience and attention to detail A tiny mistake like a missing semicolon (;) can stop the whole program, so you need patience and multiple attempts

الصبر والاهتمام بالتفاصيل: خطأ بسيط زي فاصلة منقوطة ناقصة ممكن يوقف البرنامج كله

5 · Career Fields After Learning to Program

Web Development
Mobile Apps
Artificial Intelligence
Cybersecurity
Data Analysis
Game Development
Networking

كل مجال من دول ليه طريقه الخاص — مش لازم تختار دلوقتي، بس اعرف إن الأبواب دي كلها مفتوحة قدامك.

Prepared by: Mr. Eissa Islam

6 · Hands-On Activity

Pick an example from your daily life (like a food delivery app, or a smart air conditioner) and break it down using input — processing — output:

My example
Input
Processing
Output

7 · Check Your Understanding

  1. What are the three stages a computer goes through for any task?
  2. What is the difference between programming and artificial intelligence?
  3. What is the difference between a text editor and an IDE?
  4. Name two elements of a programmer's problem-solving mindset.
  5. Name two career fields that interest you most, and explain why.
Prepared by: Mr. Eissa Islam

Session Summary

A computer carries out any task through 3 stages: input → processing → output.

Programming means specific step-by-step instructions; artificial intelligence means learning from data.

A programming language is the medium, and source code is the text the programmer writes.

A text editor is a simple tool, while an IDE is a full workshop.

And the programmer mindset = analysis + logic + continuous research + patience.

الخلاصة: الكمبيوتر بيشتغل بـ3 مراحل (مدخلات ← معالجة ← مخرجات). البرمجة تعليمات محددة خطوة بخطوة، والذكاء الاصطناعي تعلّم من البيانات. محرر النصوص أداة بسيطة، وبيئة التطوير ورشة كاملة. وعقلية المبرمج = تحليل + منطق + بحث مستمر + صبر.

Test Yourself Online

QR code linking to the quiz

10 questions · about 10 minutes

Scan this code with your phone camera to open the quiz. At the end it tells you, section by section, which parts of this session you have understood and which parts to read again.

Or open it directly:

The QR image did not load. Check your connection and reload before printing this sheet.

امسح الكود بكاميرا موبايلك. الاختبار هيوضحلك في الآخر انت فاهم إيه ومحتاج تراجع إيه.

My Notes

Prepared by: Mr. Eissa Islam