Sec 1 in programming like programming fund

engahmedeg94 5 views 12 slides Jun 18, 2024
Slide 1
Slide 1 of 12
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12

About This Presentation

Sec 1 in programming like programming fund


Slide Content

Eng: Ahmed Manu

Programming
C++
Introduction
Soft Ware

# What is the meaning of program?
The some commands which understood by the computer to perform a given task .
# Programming languages are divided into:
1. Low level languages.
That is called language machine or assembly language, It is characterized as
the fastest scripting language in execution because it does not need an
compiler , But its flaws are difficult to detect errors and difficult to deal
with because they consist of two numbers only zero and one .
2. High level languages.
Characterized by one instruction does a lot of tasks, So
that takes a fewer lines, but this language need to
compiler And take a more time than the assembly.

Variables
Other Components
Loops
Input& Output
Conditions
# language components :

Numerical
variables
character
Variables
Intger Char
Float
• Type :
VariablesType
# Variables .
It is an empty area of memory , It
has three characteristics :
• Name : Language is characterized by the
distinction between large letters and
lowercase letters .
• Value : the user is enter it .

# Flow chart ( (ريسلا تاططخم
ربتعتهجمربلاىههنيعم هلكشم لحل تاوطخ ةعومجما تاططخم ىمست مسرلاب تاوطخلا هذه لثمت امدنعو ريسل
,ىألاكشاو زومر قيرط نع هلكشم لحل تاوطخ هناجمانربلا ةباتك ليهستل كلذو اهيلع قفتم .
#ريسلا تاططخم رصانع
•هيادبهياهنو جمانربلا.
• تانايبلا لاخدا.
• تايلمعلا ءارجاهيباسحلا.
• تايلمعلاهيقطنملا.
• راركتلا.
• جئاتنلا جارخا.

# Flow chart component .
START & End
Data entry
Opreation
Print Data
Comprtor

# Steps to solve any problem .
1. Start .
2. Reserved variables .
3. Data entry .
4. Make operation .
5. Print the result .
6. End .

جماربلاو داوكلاا هباتكىفهغل
# Write aprogramto add 5 + 15 and print the result .
نيمقرلا عمجي جمانرب بتكأ (15 +5)جتانلا ةعابطب مقو
Solution :
#include <iostream.h> ءاعدتساب موقيهبتكملاهصاخلاهمجرتبجمانربلا مهفو
Void main ( ) هيادبهلادلاهيساسلاا
{ سوقهيادبجمانربلا
Int sum ; ريغتم زجحىمقر حيحص
Sum = 5 + 15 ; ريغتملا لخادب جتانلا ظفحو نيمقرلا عمجب رملاا موقي
Cout<< " the result = " ; رملاا موقيراهظابهلمجلاهروصحملانيسوقلا نيب
Cout<< sum ; رملاا موقيجارخابهميقلاهدوجوملاريغتملا لخادب
} ةياهن سوق جمانربلا
C++

# Hint .
( \n ) : it is mean new line .
( \t ) : it is mean a seven space .
( ; ) : semi colom–use to end the instruction .
( \\) : use to make a comment –hideen.

#write a program to calculate the sum of two numbers
entered by the user .
Solution :
#include <iostream.h> ءاعدتساهبتكملا
هلادلاهيسيئرلاVoid main ( )
سوقهيادب جمانربلا{
زجحتاريغتملاInt x , y , sum ;
راهظاهلمجلاىللا ىلع نيسوقلا نيبهشاشلاCout<<" enter the first number " ;
عضوهميقلاىتلا مدختسملا اهلخدي فوسCin>> x ;
راهظاهلمجلا ىلعهشاشلاCout<< " enter the secandnumber " ;
عضوهميقلاىتلا مدختسملا اهلخدي فوسىفريغتملاCin>> y ;
جتانلا ظفحو نيريغتملا عمجىف ريغتملاتلاثلاSum = x + y ;
راهظاهلمجلانيسوقلا نيبCout<< " the sum = " ;
راهظاهميقلاهظوفحملا ريغتملا لخادCout<< sum ;
} سوقهياهنجمانربلا

To become a good programmer
you have to practice it yourself
Quiz
#Write a program to multiply two numbers entered by
the user .
Eng: Ahmed Manu