Download presentation
Presentation is loading. Please wait.
Published byBrent Terry Modified over 8 years ago
1
برمجه حاسبات 2 أ. بيان غزلان الفصل الدراسي 1435 - 1436 هـ
2
لغات البرمجة تسمح للمبرمج باستخدام اللغة بشكل مشابهة لتلك التي تكتب بشكل طبيعي وهي تستند على توليد ايعازات تعتمد على الحاسوب لتنفيذ البرنامج. هنا العديد من لغات البرمجة مثل C ، Pascal ، Fortran ، Cobol ، Basic وغيرها الكثير وجميع هذه اللغات تهدف الى انجاز مهمة خاصة، تسهيل التعامل مع الحاسوب لحل المشكلات، وتنفيذ العديد من التطبيقات التي تحتاج اليها بشكل يومي ودوري. لغة البرمجة C++ تم ايجادها عام 1980 م وهي لغة قوية ومرنة لها العديد العديد من التطبيقات تمهيد
3
تدعى لغة C++ لغة مترجمة، حيث ليس بمقدورك كتابة برنامج C++ وتنفيذة على حاسبك مالم يكن لديك مترجم C++ ، هذا المترجم يستلم ايعازات لغة C++ الخاصة بك ويحولها الى شكل يمكن لحاسبتك قرائتها ( لغه الاله ) مترجم C++ هو الاداة التي يستخدمها حاسوبك لفهم ايعازات لغة C++ في برنامجك C++ هي لغة برمجة عليا أي قريبة من لغة الأنسان وفهمة ( والتي تسمح لمهندس البرمجيات بالتواصل بكفاءة مع الحاسوب. وتعد لغة C++ من اللغات ذات المرونة العالية والقابلة للتكيف. تمهيد
4
المراحل التي يمر بها برنامج C++
5
You type a C++ program (typically referred to as source code) using the editor, make any necessary corrections and save the program on a secondary storage device, such as your hard drive. C++ source code filenames often end with the.cpp,.cxx,.cc.C. PHASE 1: CREATING A PROGRAM
6
In Phase 2, you give the command to compile the program In a C++ system, a preprocessor program executes automatically before the compiler’s translation phase begins, and (so we call preprocessing Phase 2 and compiling Phase 3). The C++ preprocessor obeys commands called preprocessor directives. Which are lines included in the code of programs preceded by a hash sign (#). PHASE 2: PREPROCESSING A C++ PROGRAM
7
These lines are not program statements but directives for the preprocessor. The preprocessor examines the code before actual compilation of code begins and resolves all these directives before any code is actually generated by regular statements يستبدلها بالجمل المختبئه خلفها.
8
In Phase 3, the compiler translates the C++ program into machine-language code—also referred to as object code PHASE 3: COMPILING A C++ PROGRAM
9
C++ programs contain references to functions and data defined elsewhere, such as in the standard libraries or in the private libraries of groups of programmers working on a particular project The object code produced by the C++ compiler contains “holes” due to these missing parts. A linker links the object code with the code for the missing functions to produce an executable program (with no missing pieces). If the program compiles and links correctly, an executable image is produced. PHASE 4: LINKING
10
Before a program can be executed, it must first be placed in Memory. This is done by the loader, which takes the executable image from disk and transfers it to memory. Additional components from shared libraries that support the program are also loaded. PHASE 5: LOADING
11
Finally, the computer, under the control of its CPU, executes the program one instruction at a time. Some modern computer architectures can execute several instructions in parallel. PHASE 6: EXECUTION
12
العمليات الرياضيه ARITHMATIC OPERATORS الاولويه للضرب والقسمه اولا ثم للجمع والطرح من اليسار لليمين يمكن تغيير هذه الاولويات باستخدام الاقواس () مثال لجعل عمليه الجمع تتم قبل الضرب بالمثال السابق نستخدم الصيغه التاليه a * ( b + c ).
13
جدول الاولويات للعمليات الحسابيه PRECEDENCY
14
امثله
15
RELATIONAL OPERATORS عمليات المقارنه
16
بناء على ما تم توضيحه في المعمل من عرض اساسيات لغه سي : - اكتبي برنامج لطباعه اسمك. ا - اكتبي برنامج لتعريف 4 ارقام منها ارقام صحيحه وعشريه صغيره وكبيره وحروف وطباعتها 3 (Comparing Integers) Write a program that asks the user to enter two integers, obtains the numbers from the user, then prints the larger number followed by the words "is larger." If the numbers are equal, print the message "These numbers are equal.“ - اكتبي برنامج يطلب من المستخدم ادخال رقمين صحيحين ثم طباعه الاكبر بينهما بعباره « الرقم x هو الاكبر » واذا كانا متساويين طباعه ان « الرقمين متساويين » SIMPLE PROGRAMS مراجعه اساسيات لغه C++
17
الشروط وتراكيبها الدورانات الاقترانات المصفوفات امثله NEXT
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.