شاهد المحاضرة في فيديو مدته ٥ دقائق مع أمثلة تشتغلها بنفسك واختبار قصير، أو افتح «المحاضرة المكتوبة»: كل شريحة في صفحة بنفس نص المحاضرة الأصلية وترتيبها، وتنقّل بالأسهم أو بالسحب.
شرح صوتي مبسّط باللهجة المصرية مع المصطلحات التقنية بالإنجليزية، ومشاهد متحركة تلخص كل أفكار المحاضرة بالترتيب.
المدة: ٤ دقائق و٤٨ ثانية. المحاضرة بنفس ترتيب الشرائح الأصلية، وللنص الكامل حرفيًا افتح تبويب «المحاضرة المكتوبة».
أمثلة الفيديو
أمثلة الكود — عدّل وشغّل بنفسك
نفس أمثلة الفيديو جاهزة للتجربة هنا. عدّل أي مثال واضغط «شغّل الكود» ليُترجم ويعمل مباشرة عبر خدمة Wandbox المجانية (مترجم GCC 13). يُرسل الكود إلى تلك الخدمة عند التشغيل.
المثال ١: أول برنامج
The output appears here after you run the code.
المثال ٢: أكثر من سطر طباعة
The output appears here after you run the code.
المثال ٣: جرّب خطأ الـ semicolon
احذف علامة ; من آخر سطر الطباعة وشغّل: سيظهر لك الـ compiler رسالة syntax error ولن ينتج الملف التنفيذي حتى تصلح الخطأ — تمامًا كما في المحاضرة.
The output appears here after you run the code.
Runs on the free Wandbox service (wandbox.org), GCC 13.2.0. No account needed.
اختبار قصير
اختبر فهمك بعد المشاهدة
1. What is the only language a computer understands directly?
2. Which translator reads the whole source program, checks it for syntax errors, and saves the result to run any time?
3. How many keywords are available in C++?
4. What must every C++ statement end with?
5. Where does the execution of a C++ program start?
الشريحة ٢
Outlineالأجندة
How computer programs work
The evolution of programming language.
Program translator
SDLC(Software Development Life Cycle)
What is C++? and Why?
What are IDE?
Getting start with C++
Format a C++ program.
الملخص بالعربيةهذه أجندة المحاضرة كما وردت: كيف تعمل البرامج، تطور لغات البرمجة، المترجمات، دورة حياة تطوير البرمجيات SDLC، ما هي C++ ولماذا، ما هي بيئات IDE، البدء مع C++، وشكل برنامج C++.
الشريحة ٣
How computer programs workكيف تعمل برامج الكمبيوتر
Computers only understand machine code, which is a low-level language that consists of binary digits (0s and 1s).
To bridge the gap between human and machine code, we use programming language.
To program a computer, we need to write the instructions in a special language, which we call a programming language.
We call the instructions we send to the computer code. We call each line of instruction a line of code.
When we write code, we program the computer to do something. For this reason, we also call the code we write a computer program (or a program).
الملخص بالعربيةالكمبيوتر لا يفهم إلا لغة الآلة (أصفار وواحدات)، ونستخدم لغات البرمجة لكتابة التعليمات؛ وكل سطر تعليمات يسمى سطر كود، ومجموعة التعليمات هي البرنامج.
اختبر نفسك
What is the only language a computer understands directly?
What do we call each line of instruction sent to the computer?
الشريحة ٤
The Evolution of Programming Languagesتطور لغات البرمجة
To build programs, people use languages that are like human language.
The results are translated into machine code, which computers understand.
Programming languages fall into three broad categories:
Machine languages
Assembly languages
Higher-level languages
الملخص بالعربيةلغات البرمجة قريبة من لغة الإنسان وتُترجم نتائجها إلى لغة الآلة، وتنقسم إلى ثلاثة أنواع: لغة الآلة، ولغة التجميع، واللغات عالية المستوى.
الشريحة ٥
Machine, Assembly, and High-Level codeنفس العملية بالمستويات الثلاثة
الملخص بالعربيةنفس العملية الحسابية D = X + Y + Z تُكتب بلغة الآلة أصفاراً وواحدات، وبلغة التجميع تعليمات مثل LDA وADA وSTA، وباللغة عالية المستوى سطراً واحداً واضحاً.
الشريحة ٦
Machine Languagesلغة الآلة
Machine languages (first-generation languages) are the most basic type of computer languages.
Different types of hardware use different machine code.
Every instruction and data should be written using 0’s and 1’s.
Advantages of Machine Language:
Free High Speed
Disadvantages of Machine Language:
Machine Dependent
Complex Language Error
الملخص بالعربيةلغة الآلة هي الجيل الأول والأبسط، وتختلف من جهاز لآخر، وكل تعليمة وبيان فيها أصفار وواحدات؛ ميزتها السرعة العالية، وعيوبها أنها معتمدة على الجهاز ومعقدة وعرضة للخطأ.
اختبر نفسك
Which type of language must be written entirely in 0s and 1s?
الشريحة ٧
Assembly Languagesلغة التجميع
Assembly languages (second-generation languages) are only somewhat easier to work with than machine languages.
Developers use cryptic English-like phrases to represent strings of numbers.
The code is then translated into object code, using a translator called an assembler.
Advantages of Assembly Language:
Easy to understand and use
More control on Hardware
Disadvantages of Assembly Language:
Machine Dependent
Harder to Learn
Slow Development Time
الملخص بالعربيةلغة التجميع (الجيل الثاني) أسهل قليلاً من لغة الآلة وتستخدم عبارات قريبة من الإنجليزية تُترجم إلى كود هدف بواسطة الـ Assembler؛ أسهل في الفهم والاستخدام وتحكم أكبر في العتاد، لكنها معتمدة على الجهاز وأصعب في التعلم وأبطأ في التطوير.
الشريحة ٨
High-level Languagesاللغات عالية المستوى
High-level languages use true English-like phrasing, making them easier to use than previous languages.
Advantages:
Readability
Machine Independent
Easy debugging
Easier to maintain
Easy Documentation
Disadvantages:
Poor control on Hardware
الملخص بالعربيةاللغات عالية المستوى تستخدم عبارات إنجليزية حقيقية؛ مزاياها: سهولة القراءة، والاستقلال عن الجهاز، وسهولة تصحيح الأخطاء والصيانة والتوثيق؛ وعيبها ضعف التحكم في العتاد.
اختبر نفسك
Which of these is an advantage of high-level languages?
الشريحة ٩
PROGRAM TRANSLATORSالمترجمات
AssemblerCompilerInterpreter
الملخص بالعربيةالمترجمات ثلاثة أنواع: Assembler وCompiler وInterpreter، وستشرحها الشرائح التالية واحداً واحداً.
الشريحة ١٠
Assemblerالمجمّع
The Assembler is a Software that converts an assembly language code to machine code.
It produces binary code in form of 0s and 1s.
الملخص بالعربيةالـ Assembler برنامج يحوّل كود لغة التجميع إلى لغة آلة، وينتج كوداً ثنائياً في صورة أصفار وواحدات.
الشريحة ١١
Compilerالمترجم
A compiler is a program translator that translates a program written in a high-level language into a machine language program.
During the translation process, the compiler reads the source program and checks for syntax errors.
In case of any errors, the compiler will not create the object code until all the errors are rectified.
Once the program has been compiled, the resulting code is saved separately and can be run on its own at any time.
But, if the source code is modified then it is necessary to recompile the program again to reflect the changes.
الملخص بالعربيةالـ Compiler يترجم البرنامج كاملاً من لغة عالية المستوى إلى لغة الآلة، ويفحص الأخطاء النحوية فلا ينتج الكود الهدف حتى تُصحح جميعها، ويُحفظ الناتج ليعمل في أي وقت، وأي تعديل في المصدر يتطلب إعادة الترجمة.
اختبر نفسك
A compiler finds a syntax error in your program. What happens?
الشريحة ١٢
Interpreterالمفسّر
Translates high-level language into machine language.
Unlike compilers, it translates a statement in a program and executes immediately, i.e., before translating the next source language statement.
When an error is encountered, the execution of the program is halted and an error message is displayed.
الملخص بالعربيةالـ Interpreter يترجم وينفّذ كل جملة فوراً قبل ترجمة الجملة التالية، وعند وجود خطأ يتوقف التنفيذ وتظهر رسالة خطأ.
اختبر نفسك
Which translator executes each statement immediately, before translating the next one?
الشريحة ١٣
The Software Development Life Cycle (SDLC)دورة حياة تطوير البرمجيات
7 stages of the software development life cycle:
Analysis
Planning
Design
Development
Testing
Deployment
Maintenance
الملخص بالعربيةدورة حياة تطوير البرمجيات سبع مراحل بالترتيب: التحليل، التخطيط، التصميم، التطوير، الاختبار، النشر، الصيانة.
اختبر نفسك
Which of these is NOT one of the seven SDLC stages?
الشريحة ١٤
Development Toolsأدوات التطوير
Some of the most common tools that programmers use to develop software:
Integrated development environments (IDEs): IDEs are all-in-one tools that provide a complete environment for software development. They typically include a code editor, compiler or interpreter, debugger, and other tools such as project management and version control integration. Some popular IDEs include Visual Studio, IntelliJ IDEA, and Eclipse.
Compilers and interpreters: Compilers and interpreters are used to translate source code into machine code that can be executed by a computer. Compilers are typically used for compiled languages like C and Java, while interpreters are typically used for interpreted languages like Python and JavaScript.
Version control systems: Version control systems are used to track changes to source code over time. This allows programmers to revert to previous versions of their code if necessary, and to collaborate with other programmers on the same project.
Debugging tools: Debugging tools help programmers to find and fix bugs in their code.
الملخص بالعربيةمن أكثر أدوات المبرمج شيوعاً: بيئات التطوير المتكاملة IDE (محرر كود ومترجم ومصحح أخطاء وأدوات إدارة وتحكم في الإصدارات، مثل Visual Studio وIntelliJ IDEA وEclipse)، والمترجمات والمفسرات، وأنظمة التحكم في الإصدارات، وأدوات تتبع الأخطاء.
اختبر نفسك
What does an IDE typically include?
الشريحة ١٥
What is C++?ما هي لغة C++؟
C is a programming language developed at AT&T’s Bell Laboratories of USA in 1972.
It was designed and written by Dennis Ritchie.
In the late seventies C began to replace the more familiar languages of that time like FORTRAN, etc.
C is not as easy to understand as other languages; also, it does not have as many automatic checks as some other high-level languages.
To overcome these and other shortcomings of C, Bjarne Stroustrup of AT&T Bell Laboratories developed C++ in the early 1980s.
الملخص بالعربيةلغة C طُورت عام 1972 في مختبرات Bell بالولايات المتحدة على يد Dennis Ritchie واستبدلت لغات مألوفة مثل FORTRAN؛ وللتغلب على قصورها طوّر Bjarne Stroustrup لغة C++ في بداية الثمانينيات.
اختبر نفسك
Who developed C++, and when?
الشريحة ١٦
Why C++?لماذا C++؟
C++ is one of the world’s most popular programming languages.
C++ can be found in today’s operating systems, Graphical User Interfaces, and embedded systems.
C++ is an object-oriented programming language that gives a clear structure to programs and allows code to be reused, lowering development costs.
C++ is portable and can be used to develop applications that can be adapted to multiple platforms.
C++ is fun and easy to learn!
الملخص بالعربيةلغة C++ من أشهر لغات العالم وتوجد في أنظمة التشغيل والواجهات الرسومية والأنظمة المدمجة؛ وهي كائنية التوجه فتعطي بنية واضحة وتتيح إعادة استخدام الكود مما يخفض تكلفة التطوير، ومحمولة بين المنصات، وممتعة وسهلة التعلم.
اختبر نفسك
Why does C++ lower development costs?
الشريحة ١٧
Getting started with C++البدء مع C++
Keywords are the words whose meaning has already been explained to the C++ compiler (or in a broad sense to the computer).
There are only 32 keywords available in C++.
A constant is an entity that doesn’t change, whereas, a variable is an entity that may change.
We can store values in the computer memory. We call each storage location in the computer’s memory a variable.
Steps in learning English language:
Alphabets→Words→Sentences→Paragraph
Steps in learning C++ language:
Alphabets Digits Special symbols→Constants Variables Keywords→Instructions→Program
الملخص بالعربيةالكلمات المحجوزة Keywords معانيها معرّفة مسبقاً للمترجم وعددها 32 فقط؛ والثابت قيمة لا تتغير، أما المتغير فهو موقع تخزين في الذاكرة قد تتغير قيمته. وكما نتعلم الإنجليزية (حروف، ثم كلمات، ثم جمل، ثم فقرات) نتعلم C++ (حروف وأرقام ورموز، ثم ثوابت ومتغيرات وكلمات محجوزة، ثم تعليمات، ثم برنامج).
اختبر نفسك
How many keywords does C++ have, according to the lecture?
What is the difference between a constant and a variable?
الشريحة ١٨
Form of a C++ Programشكل برنامج C++
There are certain rules about the form of a C++ program that are applicable to all C++ programs. These are as under:
Each instruction in a C++ program is written as a separate statement.
The statements in a program must appear in the same order in which we wish them to be executed.
Blank spaces may be inserted between two words to improve the readability of the statement.
All statements should be in lowercase letters.
C++ has no specific rules for the position at which a statement is to be written in each line. That’s why it is often called a free-form language.
Every C++ statement must end with a semicolon ( ; ). Thus ; acts as a statement terminator.
الملخص بالعربيةقواعد شكل برنامج C++: كل تعليمة تُكتب جملة مستقلة، والجمل تظهر بترتيب تنفيذها، ويمكن إدخال مسافات بين الكلمات للتوضيح، وجميع الجمل بأحرف صغيرة، ولا قواعد لمكان الجملة في السطر لذلك تسمى لغة حرة الشكل، وكل جملة يجب أن تنتهي بفاصلة منقوطة ( ; ).
اختبر نفسك
What ends every C++ statement?
Why is C++ called a free-form language?
الشريحة ١٩
Let's look at a simple application in C++تطبيق بسيط بلغة C++
#include<iostream>using namespace std;
int main() {
// prints the string enclosed in double quotes
cout << "Hello World";
return 0;
}
الملخص بالعربيةأول برنامج: تضمين مكتبة iostream، ثم using namespace std، ثم دالة main وبها تعليق وجملة cout التي تطبع Hello World، وreturn 0 لإنهاء الدالة. جرّب نفس البرنامج وشغّله في صفحة «جرّب الكود» مباشرة بعد نهاية الشرائح.
الشريحة ٢٠
#include directiveالأمر #include
#include <iostream> is a header file library that lets us work with input and output objects, such as cout.
The general form:
#include<header_file>
الملخص بالعربيةالأمر #include <iostream> يضمّن مكتبة ملفات الرأس التي تتيح التعامل مع كائنات الإدخال والإخراج مثل cout، وصيغته العامة #include <header_file>.
اختبر نفسك
What does #include <iostream> give the program?
الشريحة ٢١
using namespace stdجملة using namespace std
using namespace std; means that we can use names for objects and variables from the standard library.
الملخص بالعربيةجملة using namespace std; تعني أننا نستطيع استخدام أسماء الكائنات والمتغيرات من المكتبة القياسية.
الشريحة ٢٢
How to use code comments //التعليقات في الكود
// this is a comment
Comments are used in a C++ program to clarify either the purpose of the program or the purpose of some statement. It is a good practice to begin a program with a comment indicating the purpose of the program, its author, and the date on which the program was written.
Any number of comments can be written at any place in the program.
الملخص بالعربيةالتعليقات تبدأ بـ // وتُستخدم لتوضيح الغرض من البرنامج أو من جملة معينة، ومن الممارسات الجيدة بدء البرنامج بتعليق يذكر هدفه وكاتبه وتاريخ كتابته، ويمكن كتابة أي عدد من التعليقات في أي مكان بالبرنامج.
الشريحة ٢٣
main() functionدالة main
In C++ programming language the main() function serves a special purpose, it tells the compiler where the program starts.
The body of the main function surrounded by curly braces ( { } ).
return 0 ends the main function.
الملخص بالعربيةدالة main() وظيفتها خاصة: تخبر المترجم من أين يبدأ البرنامج، وجسمها محاط بقوسين معقوفين { }، وreturn 0 ينهي الدالة الرئيسية.
اختبر نفسك
Which line tells the compiler where the program starts?
الشريحة ٢٤
Output using coutالطباعة باستخدام cout
The only executable statement in the program is: cout << “Hello World";
which displays the enclosed text i.e. Hello World
الملخص بالعربيةالجملة التنفيذية الوحيدة في البرنامج هي cout << “Hello World”; وتعرض النص المضمّن Hello World.
الشريحة ٢٥
Compilation and Executionالترجمة والتنفيذ
To type your C++ program, you need another program called IDE.
Once the program has been typed it needs to be converted to machine language instructions. To carry out this conversion, we need Compiler.
الملخص بالعربيةلكتابة برنامجك بلغة C++ تحتاج إلى برنامج آخر هو بيئة التطوير IDE، وبعد كتابة البرنامج يجب تحويله إلى تعليمات لغة الآلة، ولإجراء هذا التحويل نحتاج إلى الـ Compiler.
اختبر نفسك
Which two tools take a program from typed text to a running program?
جرّب الكود
Run the example yourselfشغّل المثال بنفسك
Edit the code and run it here. It compiles and runs on Wandbox, a free online compiler service (GCC 13). Short programs only, and the code leaves this page to that service when you run it.
عدّل الكود وشغّله من هنا مباشرة عبر خدمة Wandbox المجانية (مترجم GCC 13). للبرامج القصيرة فقط، ويُرسل الكود إلى تلك الخدمة عند التشغيل.
The output appears here after you run the code.
Runs on the free Wandbox service (wandbox.org), GCC 13.2.0. No account needed.
2. Compare between compiler, interpreter, and assembler.
Compiler, interpreter, and assembler compared
Assembler
Compiler
Interpreter
Translates
Assembly language to machine code
A whole high-level program to machine language
A high-level program to machine language
How it works
Produces binary code of 0s and 1s
Checks the whole source for syntax errors, then saves the compiled code to run any time
Translates one statement and executes it immediately, before the next
On errors
Not covered in the lecture
No object code until all errors are fixed
Execution halts and an error message is shown
3. What is an IDE?
An integrated development environment: an all-in-one tool that provides a complete environment for software development, typically a code editor, compiler or interpreter, debugger, and tools such as project management and version control integration. Examples: Visual Studio, IntelliJ IDEA, Eclipse.
True or false
1. C++ programming language is an interpreted language.
2. The base for almost all popular programming languages is Fortran.
3. Comments in C++ can be executed by the compiler.
4. Each instruction in a C++ program is written as a separate statement.
5. Every C++ statement does not necessarily end with a semicolon (;).
6. In C programming language, main() tells the compiler where the program starts.
7. Cout is used to output text.
8. Machine language is machine dependent.
9. Assembly language is more difficult than machine language.
10. The assembler is a software that converts assembly language code to machine code.
Programming task
Write a C++ program to print your name, date of birth, and mobile number. Start from this template, replace the placeholder text, and run it here.
The output appears here after you run the code.
Runs on the free Wandbox service (wandbox.org), GCC 13.2.0. No account needed.
التحميلات
The original filesالملفات الأصلية
الملفان الأصليان للمحاضرة وورقة التمارين كما وردا.