SlideShare uma empresa Scribd logo
1 de 49
Baixar para ler offline
Prog_2 course- 2014 
2 bytes team 
Kinan keshkeh 
IT Engineering-Damascus University 
3rd year
Let’s Remember!! SomeOf Prog_1 :D
Program 2Bytes_pro; 
Uses wincrt; 
Var k,x,y,z :integer; 
Procedure proc1(a:integer; var b:integer ;) 
var i,x: integer; 
Begin 
i:=10; x:=7; y:=12; a:=2; b:=4; 
end; 
Begin 
x:=3; y:=5; proc1(k,z); 
Writeln(„z=„,z); 
Writeln(„k=„,k); 
Writeln(„x=„,x); 
Writeln(„y=„,y); 
Writeln(„i=„,i); 
End. 
+1 
+1 
+1 
+1 
+1 
{ z=4 } 
{Random value often be zero} 
{ x=3 } 
{ y=12 } 
{ error }
In procedures and functions There are four types of variables : 
1.General Variables : are variables that are written at the top of the program befor all procedures and functions and we can see it and deal with it by all procedures and functions in the main program (like : k , x , y , z) . 
2.Local Variables : are variables that are declared in the statements part within procedure or function and we can‟t see it and deal with it outside that procedures (like : i , x ) . 
3.Formality Variables : are variables that appear in the header of procedure or function and it is formality and is not reserved place for it in memory (like a , b ) 
 we have two types of formality variables 
1) input variables : Keeps the value entered by after the completion of the procedural ( like : a) 
2)output variables : Keeps the value obtained by the procedure. And we writes before it the reserved word (var) (like : b ) 
4.Actual Variables : are variables that main program pass it to procedure or function during a summons and it agree formality variables in number and type (like : k , z)
Notes : 
Local variables have priority from general variables in the same Field of vision ( ايؤرنا لاجي ) ( like : x) 
 Execution always start form (begin) by the main program 
 in string : 
var : name , lname : string ; 
begin writeln(„enter the name and lname „); 
readln(name , lname); 
writeln(name); 
writeln(lname); 
End. 
Ahmed 
Ali 
Inputs : 
Ahmed Ali 
X nothing 
outputs 
name); 
readln(lname); 
+1
SETS 
A П B 
A 
B
What is a DiscreteType?? 
Discrete Data Type: 
Integer 
boolean 
char 
Enumerated 
Day=(sat,sun,mon,tu,wed,th,fri) 
Like..
Definition 
The SET is a Data Structure which contain discrete type elements .. 
Doesn‟t have index.!! 
<Nameof varible > :Set of < discrete type > 
We can‟t define the set as this form : 
S : Set of Integer; 
Because set can have 256 components at most and all its component values should be in rang 0 .. 255 .
Ex: 
•S1 : Set of 1..100; 
•S2 : Set of „a‟..‟z‟; 
•S : Set of Days; 
•S : Set of 66..256; 
•S: set of char ; 
{True} 
{True} 
{True} 
{False} 
+1 
{True}
Set Handling 
Var: 
s1:set of 0..255; 
S2,s3:set of 40..100; 
S4:set of „a‟..‟z‟;
S1 := [ 55, 80, 99, 80, 600, 41, 44..55]; 
Isn‟t added 
S1: 
41 44..55 80 99
S1 : 
S1 := [];
S2 := [200,20]; 
S2: 
40..100 
“NO Change”
S4 := [‘B’,’A’,’c’,’a’]; 
S4: 
„a‟ „c‟
S4 := [I,k]; 
Var I,k:integer; 
i:=1; k:=k+1; 
+1 
S4: 
Compile Error !!
S1 := [I,j]; 
Var I,j:integer; 
i:=1; j:=i*9; 
+1 
S1: 
1,9
i, j : integer; i := 1; j := i-1; S1 := [i, j]; S1 := S1 + [i*2]; 
S1: 
0,1,2 
+1
S1:=S4; 
+1 
Error 
Ya fahmaneen !! :D
Operation 
•To put a value in it , we use [value] . 
•The operations on Sets : 
⋂ ⇔ * 
⋃ ⇔ + 
/ ⇔ - 
⊆ ⇔ <= 
⊇ ⇔ >= 
∈ ⇔ in
Program SetsOperator; Var A0 : set of 1..15; A1 : set of 1..10; A2 : set of 5..15; i : integer; Begin A1 := [1..10]; A2 := [5..15]; A0 := A1*A2; {A0=[5..10]} A0 := A1+A2; {A0=[1..15]} A0 := A1-A2; {A0=[1..4]} A0 := A0-[1]; {A0=[2..4]}
A1 := [2,3]; 
A2 := [1,2,3,4,5]; 
if (A1 <= A2) then {or (A2 >= A1)} 
writeln ('A1 is a subset of A2'); 
readln (i); 
if (i in A1) then 
writeln (i,' is in A1') 
else 
writeln (i,' is not in A1'); 
End;
True statement 
A0, A1 : Set of 1..15; A : boolean; A0 := [1, 2]; A1 := [2, 4]; A0 := A0 – [77]; A := A1 >= A0; A := 1 in A0;
Const Sets 
Type 
Digits = set of 0..9; 
Const 
HexD : set of '0'..'z‘ = 
['0'..'9', 'A'..'F', 'a'..'f']; 
ED : Digits = [0, 2, 4, 6, 8]; 
Var 
d : Digits; 
Begin 
d := [8]; 
d := ED; {d=[0,2,4,6,8]} 
ED:=ED+[9]; 
ED:=d; 
End. 
+1 
Error .. Fateh 3eoonk !!
Enum Set 
Type 
Day = (sun,mon,….,sat); 
Name=(koko,soso,fofo,fifi); 
Var 
days: Set of Day; 
N:set of Name 
Begin 
Days:=[sun..sat]; 
N:=[KOKO,SOSO]; 
End.
Read & Print Sets :
Program Test(); Type SInt = Set of 1..150 ; SCh = Set of ‘0’..’z’; Var S1 : SInt; S2 : SCh; Slen : Integer; Begin Readln(Slen); ReadsetI(S1 , Slen); ReadsetC(S2 , Slen); PrintsetI(S1 , Slen); PrintsetC(S2 , Slen); Readln; End.
Read Integer Sets 
Procedure ReadsetI (var S:SInt; L:integer) ; 
var 
i, x : integer; 
Begin 
s:=[]; 
For i:=1 to L do 
begin 
Read(x); 
S := S + [x]; 
end; 
End;
Read Char Sets 
Procedure ReadsetC (var S:SCh; L:integer) ; var i, x : Char; Begin s:=[]; For i:=1 to L do begin Read(x); S := S + [x]; end; End;
Print Integer Sets Using While Loop: 
Procedure PrintsetI (S : SInt) ; 
var 
I : Integer; 
Begin 
I := 0; 
While ( S <> []) do 
If (I in S) then 
begin 
Writeln(I); 
S := S – [I]; 
end; 
I := I + 1; 
End;
Print Integer Sets Using For Loop 
Procedure PrintsetI (S : SI) ; var I : Integer; Begin For I:=1 to 32700 do Begin If (I in S) then Begin Writeln(I); S := S – [I]; End; If (S = []) then I := 32700; End; End;
Exercise : 
يرى في يؼهذ يا إػطاء دوراخ في يادذي انرياضياخ وانهغح الإ كَهيسيح 
يؼطى كم طانة ػ ذُ ذسجيهه في ان ؼًهذ رقى فريذ يحصىر تي 1..100 فإرا ػه دً أ ػذد انطلاب في كم يادج لا يرجاوز 50 طانة 
ان طًهىب كراتح تر اَيج ػاو تاسرخذاو الاجرائياخ وان جً ىًػاخ ورنك 
نهقياو تان هًاو انرانيح : 
. 
1 ذشكيم يج ىًػح نطلاب انرياضياخ ويج ىًػح نطلاب انهغح 
الإ كَهيسيح )إدخال ػ اُصر ان جً ىًػح ( 
. 
2 إجراء نطثاػح ػ اُصر ان جً ىًػح 
. 
3 إجراء لإػطاء يج ىًػح تأرقاو انطلاب ان سًجهي تان اًدذي . 
4 قررخ إدارج ان ؼًهذ ذخفيض ػذد انطلاب ورنك تالاسرغ اُء ػ ػذد 
يحذد ي هُى يذخم ي نىحح ان فًاذيح ػهى أ يرى اخريار أرقاو 
انطلاب ان فًصىني تشكم ػشىائي وان طًهىب كراتح إجراء ن قُم 
أرقاو انطلاب ان فًصىني إنى يج ىًػح جذيذج 
. 
5 وضغ أرقاو انطلاب ان فًصىني ض شؼاع
Program prog2byte_team; 
Uses wincrt; 
Type students=set of 1..100; 
numbers=array[1..50] of 1..100; 
Var seng,smath : students; 
Procedure inputset(var s : students; m:integer); 
Var i,x: integer; 
Begin 
s:=[ ]; 
i:=0; 
While (i<m) do 
begin 
writeln(„input students number „); 
readln(x); 
if (x in s) then 
writeln(„ you input this number befor please enter 
another number „) 
else 
begin 
i:=i+1; 
s:=s+[x]; 
end; 
end; 
End; 
numbers of students
Procedure printset(s :students); 
Var i:integer; 
Begin 
i:=1; 
While (s<>[ ]) do 
begin 
if (i in s) then 
begin 
write(i:5); 
s:=s-[ i ]; 
end; 
i:=i+1; 
end; 
writeln; 
End;
Procedure bothsub(s1,s2 : students; var s3: students); 
Begin 
s3:=s1*s2; 
End;
Procedure deletestd(var s,n : students); 
Var k,i,x ; integer; 
Begin 
n:= [ ]; 
Randomize; 
i:=0; 
Writeln(„enter the number you want to go throw out „); 
Readln(x); 
While (i<x) do 
begin 
k:= random(100) + 1; 
if ( k in s ) then 
begin 
s:=s – [ k ]; 
seng:= seng – [ k ]; 
smath:=smath – [ k ]; 
i:=i+1; 
n:=n + [ k ]; 
end; 
end; 
End; 
بلاطنا حػىًجي 
ان فًصىني يج ىًػح 
انرقاطغ 
:Randomize يقىو ترىنيذ 
أرقاو ػشىائيح أػر اًدا ػهى 
ساػح ان ظُاو 
:Random(100)=0..99; 
Random(100)+1=1..100
Procedure setinArray(s: students; var a: numbers ; var k: integer); 
Var i : integer; 
Begin 
K:=0; 
For i:=1 to 100 do 
If (i in s) then 
begin 
k:=k+1; 
a[k]:=i; 
end; 
End; 
ي أجم اسرذػاء 
انشؼاع في انثر اَيج 
انرئيسي
Var nmath,neng,k,i :integer; 
Aunaccepted : numbers; 
Sunaccepted,sboth : students; 
Begin 
Writeln(„enter the number of math students „); 
Readln(nmath); 
Inputset(smath,nmath); 
Writeln(„enter the number of English students „); 
Readln(neng); 
Inputset(seng,neng); 
Bothsub(smath , seng , sboth); 
Printset(sboth); 
Deletestd(sboth,Sunaccepted); 
Printset(Sunaccepted); 
setinArray(Sunaccepted,Aunaccepted,k); 
For i:=1 to k do 
Writeln(Aunaccepted[i]:5); 
Readln; 
End.
Homework: 
Creat and read two arrays of student numbers, student numbers in Prog and in English. 
-We want to know the students numbers at the two subjects..?! 
-what are the student numbers at the Prog and Not at English ?? 
+10 point
Group : group link Mobile phone- Kinan : 0994385748 Facebook account : kinan’s account 
2 bytes team
Revision Practise
Ques: 
write a programme DO: 
1-Read An Array 2-Print An Array//Proce 
3-function to find the min elem in the array 
4-Procedure to find the Sum array(of the tow arrays). 
5- Multi array 
Write the Main Program..
Programme P-Matrix; 
Const nMax=20; mMax=20; 
Type Matrix=array[1..nmax,1..mmax] of real; 
Var A,B,Add,mult :Matrix; 
n1,n2 :1..nmax; 
m1,m2 :1..mmax; 
min: integer;
Procedure ReadMat(Var: n:1..nmax;var m:1..mmax; var A:matrix); 
Var i,j:integer; 
begin 
writeln(„enter the first Dimention of matrix< ‟ ,nmax); 
Readln(n); 
writeln(„enter the second Dimention of matrix< ‟ ,mmax); 
Readln(m); 
for i:=1 to n do 
begin 
for j:=1 to m do read(A[I,j]); {hint} 
readln; {hint} 
end; 
end;
Procedure WriteMat(Var: n:1..nmax;var m:1..mmax; var A:matrix); 
Var i,j:integer; 
begin 
for i:=1 to n do 
begin 
for j:=1 to m do write(A[i,j],‟ ‟); 
writeln; 
end; 
end;
Function MinOfMatrix(n:1..nmax,m:1..mmax;A:matrix):real 
Var i,j:integer; min:real; 
begin 
min:=A[1,1]; 
For i:=1 to n do 
for j:=1 to m do 
if (A[i,j]<min) then 
min:=A[i,j]; 
MinOfMatrix:=min; 
end;
Procedure Add_Tow_Matrix(n1,n2:1..nmax; m1,m2:1..mmax; var n3:1..nmax; var m3:1..mmax; var c:Matrix); 
Var i,j:integer; 
begin 
if(n1<>n2)or(m1<>m2) then 
writeln(„the addition is impossible‟); 
else 
begin 
n3:=n1; m3:=m1; 
for i:=1 to n3 do 
for j:=1 to m3 do 
C[i.j]:=A[i,j]+B[i,j]; 
end; 
end;
Procedure Mult_Tow_Matrix(n1,n2:1..nmax; m1,m2:1..mmax; var n3:1..nmax; var m3:1..mmax; var c:Matrix); 
Var i,j,k:integer; 
begin 
if(n1<>m2) then 
writeln(„the multi is impossible‟); 
else 
begin 
n3:=n2; m3:=m1; { A(m1,n1)*B(m2,n2)=C(m3,n3)} 
for i:=1 to n3 do 
for j:=1 to m3 do 
begin 
C[i,j]=0; 
for k:=1 to m2 
C[i.j]:= C[i.j] +A[i,k]*B[k,j]; 
end; 
end; 
end;
Begin 
ReadMat(n1,m1,A); WriteMat(n1,m1,A); 
ReadMat(n2,m2,B); WriteMat(n2,m2,B); 
writeln(„the minimum of the first Mat = ‟); 
min:=MinOfMatrix(n1,m1,A); writeln(min); 
Add_Tow_Matrix(n1.m1,n2,m2,A,B,n3,m3,Add); 
WriteMat(n3,m3,Add); 
Mult_Tow_Matrix(n1,n2,m1,m2,A,B, n3,m3,mult); 
WriteMat(n3,m3,mult); 
End;
Group : group link Mobile phone- Kinan : 0994385748 Facebook account : kinan’s account 
2 bytes team

Mais conteúdo relacionado

Mais procurados

Scope Graphs: A fresh look at name binding in programming languages
Scope Graphs: A fresh look at name binding in programming languagesScope Graphs: A fresh look at name binding in programming languages
Scope Graphs: A fresh look at name binding in programming languagesEelco Visser
 
c-programming-using-pointers
c-programming-using-pointersc-programming-using-pointers
c-programming-using-pointersSushil Mishra
 
Lec23-CS110 Computational Engineering
Lec23-CS110 Computational EngineeringLec23-CS110 Computational Engineering
Lec23-CS110 Computational EngineeringSri Harsha Pamu
 
Crafting Custom Interfaces with Sub::Exporter
Crafting Custom Interfaces with Sub::ExporterCrafting Custom Interfaces with Sub::Exporter
Crafting Custom Interfaces with Sub::ExporterRicardo Signes
 
The Death of Final Tagless
The Death of Final TaglessThe Death of Final Tagless
The Death of Final TaglessJohn De Goes
 
M|18 User Defined Functions
M|18 User Defined FunctionsM|18 User Defined Functions
M|18 User Defined FunctionsMariaDB plc
 
Programming Fundamentals Arrays and Strings
Programming Fundamentals   Arrays and Strings Programming Fundamentals   Arrays and Strings
Programming Fundamentals Arrays and Strings imtiazalijoono
 
Functional Stream Processing with Scalaz-Stream
Functional Stream Processing with Scalaz-StreamFunctional Stream Processing with Scalaz-Stream
Functional Stream Processing with Scalaz-StreamAdil Akhter
 
Side by Side - Scala and Java Adaptations of Martin Fowler’s Javascript Refac...
Side by Side - Scala and Java Adaptations of Martin Fowler’s Javascript Refac...Side by Side - Scala and Java Adaptations of Martin Fowler’s Javascript Refac...
Side by Side - Scala and Java Adaptations of Martin Fowler’s Javascript Refac...Philip Schwarz
 
FS2 for Fun and Profit
FS2 for Fun and ProfitFS2 for Fun and Profit
FS2 for Fun and ProfitAdil Akhter
 
Templates in C++
Templates in C++Templates in C++
Templates in C++Tech_MX
 
Data Structure Project File
Data Structure Project FileData Structure Project File
Data Structure Project FileDeyvessh kumar
 

Mais procurados (20)

Scope Graphs: A fresh look at name binding in programming languages
Scope Graphs: A fresh look at name binding in programming languagesScope Graphs: A fresh look at name binding in programming languages
Scope Graphs: A fresh look at name binding in programming languages
 
c-programming-using-pointers
c-programming-using-pointersc-programming-using-pointers
c-programming-using-pointers
 
C programs
C programsC programs
C programs
 
Pnno
PnnoPnno
Pnno
 
Ada file
Ada fileAda file
Ada file
 
Lec23-CS110 Computational Engineering
Lec23-CS110 Computational EngineeringLec23-CS110 Computational Engineering
Lec23-CS110 Computational Engineering
 
Crafting Custom Interfaces with Sub::Exporter
Crafting Custom Interfaces with Sub::ExporterCrafting Custom Interfaces with Sub::Exporter
Crafting Custom Interfaces with Sub::Exporter
 
The Death of Final Tagless
The Death of Final TaglessThe Death of Final Tagless
The Death of Final Tagless
 
Algorithm and Programming (Array)
Algorithm and Programming (Array)Algorithm and Programming (Array)
Algorithm and Programming (Array)
 
M|18 User Defined Functions
M|18 User Defined FunctionsM|18 User Defined Functions
M|18 User Defined Functions
 
C program
C programC program
C program
 
Programming Fundamentals Arrays and Strings
Programming Fundamentals   Arrays and Strings Programming Fundamentals   Arrays and Strings
Programming Fundamentals Arrays and Strings
 
Functional Stream Processing with Scalaz-Stream
Functional Stream Processing with Scalaz-StreamFunctional Stream Processing with Scalaz-Stream
Functional Stream Processing with Scalaz-Stream
 
Scalaz
ScalazScalaz
Scalaz
 
Side by Side - Scala and Java Adaptations of Martin Fowler’s Javascript Refac...
Side by Side - Scala and Java Adaptations of Martin Fowler’s Javascript Refac...Side by Side - Scala and Java Adaptations of Martin Fowler’s Javascript Refac...
Side by Side - Scala and Java Adaptations of Martin Fowler’s Javascript Refac...
 
FS2 for Fun and Profit
FS2 for Fun and ProfitFS2 for Fun and Profit
FS2 for Fun and Profit
 
java sockets
 java sockets java sockets
java sockets
 
BCSL 058 solved assignment
BCSL 058 solved assignmentBCSL 058 solved assignment
BCSL 058 solved assignment
 
Templates in C++
Templates in C++Templates in C++
Templates in C++
 
Data Structure Project File
Data Structure Project FileData Structure Project File
Data Structure Project File
 

Semelhante a 2Bytesprog2 course_2014_c1_sets

Cse115 lecture08repetitionstructures part02
Cse115 lecture08repetitionstructures part02Cse115 lecture08repetitionstructures part02
Cse115 lecture08repetitionstructures part02Md. Ashikur Rahman
 
2Bytesprog2 course_2014_c8_units
2Bytesprog2 course_2014_c8_units2Bytesprog2 course_2014_c8_units
2Bytesprog2 course_2014_c8_unitskinan keshkeh
 
Kumpulan contoh-program-pascal
Kumpulan contoh-program-pascalKumpulan contoh-program-pascal
Kumpulan contoh-program-pascalrey25
 
DAA Lab File C Programs
DAA Lab File C ProgramsDAA Lab File C Programs
DAA Lab File C ProgramsKandarp Tiwari
 
Let us C (by yashvant Kanetkar) chapter 3 Solution
Let us C   (by yashvant Kanetkar) chapter 3 SolutionLet us C   (by yashvant Kanetkar) chapter 3 Solution
Let us C (by yashvant Kanetkar) chapter 3 SolutionHazrat Bilal
 
Csci101 lect03 algorithms_i
Csci101 lect03 algorithms_iCsci101 lect03 algorithms_i
Csci101 lect03 algorithms_iElsayed Hemayed
 
introduction to c programming and C History.pptx
introduction to c programming and C History.pptxintroduction to c programming and C History.pptx
introduction to c programming and C History.pptxManojKhadilkar1
 
COMPUTER GRAPHICS LAB MANUAL
COMPUTER GRAPHICS LAB MANUALCOMPUTER GRAPHICS LAB MANUAL
COMPUTER GRAPHICS LAB MANUALVivek Kumar Sinha
 
Lab manual operating system [cs 502 rgpv] (usefulsearch.org) (useful search)
Lab manual operating system [cs 502 rgpv] (usefulsearch.org)  (useful search)Lab manual operating system [cs 502 rgpv] (usefulsearch.org)  (useful search)
Lab manual operating system [cs 502 rgpv] (usefulsearch.org) (useful search)Make Mannan
 
Daapracticals 111105084852-phpapp02
Daapracticals 111105084852-phpapp02Daapracticals 111105084852-phpapp02
Daapracticals 111105084852-phpapp02Er Ritu Aggarwal
 
CLISP Lab Manual - Dr.J.VijiPriya
CLISP Lab Manual - Dr.J.VijiPriyaCLISP Lab Manual - Dr.J.VijiPriya
CLISP Lab Manual - Dr.J.VijiPriyaVijiPriya Jeyamani
 
Scala as a Declarative Language
Scala as a Declarative LanguageScala as a Declarative Language
Scala as a Declarative Languagevsssuresh
 
PCA-2 Programming and Solving 2nd Sem.pdf
PCA-2 Programming and Solving 2nd Sem.pdfPCA-2 Programming and Solving 2nd Sem.pdf
PCA-2 Programming and Solving 2nd Sem.pdfAshutoshprasad27
 
PCA-2 Programming and Solving 2nd Sem.docx
PCA-2 Programming and Solving 2nd Sem.docxPCA-2 Programming and Solving 2nd Sem.docx
PCA-2 Programming and Solving 2nd Sem.docxAshutoshprasad27
 

Semelhante a 2Bytesprog2 course_2014_c1_sets (20)

Struct examples
Struct examplesStruct examples
Struct examples
 
Cse115 lecture08repetitionstructures part02
Cse115 lecture08repetitionstructures part02Cse115 lecture08repetitionstructures part02
Cse115 lecture08repetitionstructures part02
 
2Bytesprog2 course_2014_c8_units
2Bytesprog2 course_2014_c8_units2Bytesprog2 course_2014_c8_units
2Bytesprog2 course_2014_c8_units
 
Kumpulan contoh-program-pascal
Kumpulan contoh-program-pascalKumpulan contoh-program-pascal
Kumpulan contoh-program-pascal
 
Kumpulan program pascal
Kumpulan program pascalKumpulan program pascal
Kumpulan program pascal
 
DAA Lab File C Programs
DAA Lab File C ProgramsDAA Lab File C Programs
DAA Lab File C Programs
 
Let us C (by yashvant Kanetkar) chapter 3 Solution
Let us C   (by yashvant Kanetkar) chapter 3 SolutionLet us C   (by yashvant Kanetkar) chapter 3 Solution
Let us C (by yashvant Kanetkar) chapter 3 Solution
 
C Language Lecture 17
C Language Lecture 17C Language Lecture 17
C Language Lecture 17
 
Csci101 lect03 algorithms_i
Csci101 lect03 algorithms_iCsci101 lect03 algorithms_i
Csci101 lect03 algorithms_i
 
Programs.doc
Programs.docPrograms.doc
Programs.doc
 
AI-Programs.pdf
AI-Programs.pdfAI-Programs.pdf
AI-Programs.pdf
 
introduction to c programming and C History.pptx
introduction to c programming and C History.pptxintroduction to c programming and C History.pptx
introduction to c programming and C History.pptx
 
COMPUTER GRAPHICS LAB MANUAL
COMPUTER GRAPHICS LAB MANUALCOMPUTER GRAPHICS LAB MANUAL
COMPUTER GRAPHICS LAB MANUAL
 
Lab manual operating system [cs 502 rgpv] (usefulsearch.org) (useful search)
Lab manual operating system [cs 502 rgpv] (usefulsearch.org)  (useful search)Lab manual operating system [cs 502 rgpv] (usefulsearch.org)  (useful search)
Lab manual operating system [cs 502 rgpv] (usefulsearch.org) (useful search)
 
DSC program.pdf
DSC program.pdfDSC program.pdf
DSC program.pdf
 
Daapracticals 111105084852-phpapp02
Daapracticals 111105084852-phpapp02Daapracticals 111105084852-phpapp02
Daapracticals 111105084852-phpapp02
 
CLISP Lab Manual - Dr.J.VijiPriya
CLISP Lab Manual - Dr.J.VijiPriyaCLISP Lab Manual - Dr.J.VijiPriya
CLISP Lab Manual - Dr.J.VijiPriya
 
Scala as a Declarative Language
Scala as a Declarative LanguageScala as a Declarative Language
Scala as a Declarative Language
 
PCA-2 Programming and Solving 2nd Sem.pdf
PCA-2 Programming and Solving 2nd Sem.pdfPCA-2 Programming and Solving 2nd Sem.pdf
PCA-2 Programming and Solving 2nd Sem.pdf
 
PCA-2 Programming and Solving 2nd Sem.docx
PCA-2 Programming and Solving 2nd Sem.docxPCA-2 Programming and Solving 2nd Sem.docx
PCA-2 Programming and Solving 2nd Sem.docx
 

Mais de kinan keshkeh

10 Little Tricks to Get Your Class’s Attention (and Hold It)
10 Little Tricks to Get Your  Class’s Attention (and Hold It)10 Little Tricks to Get Your  Class’s Attention (and Hold It)
10 Little Tricks to Get Your Class’s Attention (and Hold It)kinan keshkeh
 
Simpson and lagranje dalambair math methods
Simpson and lagranje dalambair math methods Simpson and lagranje dalambair math methods
Simpson and lagranje dalambair math methods kinan keshkeh
 
Shapes and calculate (area and contour) / C++ oop concept
Shapes and calculate (area and contour) / C++ oop conceptShapes and calculate (area and contour) / C++ oop concept
Shapes and calculate (area and contour) / C++ oop conceptkinan keshkeh
 
Shapes and calculate (area and contour) / C++ oop concept
Shapes and calculate (area and contour) / C++ oop conceptShapes and calculate (area and contour) / C++ oop concept
Shapes and calculate (area and contour) / C++ oop conceptkinan keshkeh
 
GeneticAlgorithms_AND_CuttingWoodAlgorithm
GeneticAlgorithms_AND_CuttingWoodAlgorithm  GeneticAlgorithms_AND_CuttingWoodAlgorithm
GeneticAlgorithms_AND_CuttingWoodAlgorithm kinan keshkeh
 
Algorithm in discovering and correcting words errors in a dictionary or any w...
Algorithm in discovering and correcting words errors in a dictionary or any w...Algorithm in discovering and correcting words errors in a dictionary or any w...
Algorithm in discovering and correcting words errors in a dictionary or any w...kinan keshkeh
 
2Bytesprog2 course_2014_c9_graph
2Bytesprog2 course_2014_c9_graph2Bytesprog2 course_2014_c9_graph
2Bytesprog2 course_2014_c9_graphkinan keshkeh
 
2Bytesprog2 course_2014_c7_double_lists
2Bytesprog2 course_2014_c7_double_lists2Bytesprog2 course_2014_c7_double_lists
2Bytesprog2 course_2014_c7_double_listskinan keshkeh
 
2Bytesprog2 course_2014_c6_single linked list
2Bytesprog2 course_2014_c6_single linked list2Bytesprog2 course_2014_c6_single linked list
2Bytesprog2 course_2014_c6_single linked listkinan keshkeh
 
2Bytesprog2 course_2014_c5_pointers
2Bytesprog2 course_2014_c5_pointers2Bytesprog2 course_2014_c5_pointers
2Bytesprog2 course_2014_c5_pointerskinan keshkeh
 
2Bytesprog2 course_2014_c4_binaryfiles
2Bytesprog2 course_2014_c4_binaryfiles2Bytesprog2 course_2014_c4_binaryfiles
2Bytesprog2 course_2014_c4_binaryfileskinan keshkeh
 
2Bytesprog2 course_2014_c3_txtfiles
2Bytesprog2 course_2014_c3_txtfiles2Bytesprog2 course_2014_c3_txtfiles
2Bytesprog2 course_2014_c3_txtfileskinan keshkeh
 
2Bytesprog2 course_2014_c2_records
2Bytesprog2 course_2014_c2_records2Bytesprog2 course_2014_c2_records
2Bytesprog2 course_2014_c2_recordskinan keshkeh
 
2Bytesprog2 course_2014_c1_sets
2Bytesprog2 course_2014_c1_sets2Bytesprog2 course_2014_c1_sets
2Bytesprog2 course_2014_c1_setskinan keshkeh
 
2Bytesprog2 course_2014_c1_sets
2Bytesprog2 course_2014_c1_sets2Bytesprog2 course_2014_c1_sets
2Bytesprog2 course_2014_c1_setskinan keshkeh
 
2Bytesprog2 course_2014_c1_sets
2Bytesprog2 course_2014_c1_sets2Bytesprog2 course_2014_c1_sets
2Bytesprog2 course_2014_c1_setskinan keshkeh
 
2 BytesC++ course_2014_c13_ templates
2 BytesC++ course_2014_c13_ templates2 BytesC++ course_2014_c13_ templates
2 BytesC++ course_2014_c13_ templateskinan keshkeh
 
2 BytesC++ course_2014_c12_ polymorphism
2 BytesC++ course_2014_c12_ polymorphism2 BytesC++ course_2014_c12_ polymorphism
2 BytesC++ course_2014_c12_ polymorphismkinan keshkeh
 
2 BytesC++ course_2014_c11_ inheritance
2 BytesC++ course_2014_c11_ inheritance2 BytesC++ course_2014_c11_ inheritance
2 BytesC++ course_2014_c11_ inheritancekinan keshkeh
 
2 BytesC++ course_2014_c10_ separate compilation and namespaces
2 BytesC++ course_2014_c10_ separate compilation and namespaces 2 BytesC++ course_2014_c10_ separate compilation and namespaces
2 BytesC++ course_2014_c10_ separate compilation and namespaces kinan keshkeh
 

Mais de kinan keshkeh (20)

10 Little Tricks to Get Your Class’s Attention (and Hold It)
10 Little Tricks to Get Your  Class’s Attention (and Hold It)10 Little Tricks to Get Your  Class’s Attention (and Hold It)
10 Little Tricks to Get Your Class’s Attention (and Hold It)
 
Simpson and lagranje dalambair math methods
Simpson and lagranje dalambair math methods Simpson and lagranje dalambair math methods
Simpson and lagranje dalambair math methods
 
Shapes and calculate (area and contour) / C++ oop concept
Shapes and calculate (area and contour) / C++ oop conceptShapes and calculate (area and contour) / C++ oop concept
Shapes and calculate (area and contour) / C++ oop concept
 
Shapes and calculate (area and contour) / C++ oop concept
Shapes and calculate (area and contour) / C++ oop conceptShapes and calculate (area and contour) / C++ oop concept
Shapes and calculate (area and contour) / C++ oop concept
 
GeneticAlgorithms_AND_CuttingWoodAlgorithm
GeneticAlgorithms_AND_CuttingWoodAlgorithm  GeneticAlgorithms_AND_CuttingWoodAlgorithm
GeneticAlgorithms_AND_CuttingWoodAlgorithm
 
Algorithm in discovering and correcting words errors in a dictionary or any w...
Algorithm in discovering and correcting words errors in a dictionary or any w...Algorithm in discovering and correcting words errors in a dictionary or any w...
Algorithm in discovering and correcting words errors in a dictionary or any w...
 
2Bytesprog2 course_2014_c9_graph
2Bytesprog2 course_2014_c9_graph2Bytesprog2 course_2014_c9_graph
2Bytesprog2 course_2014_c9_graph
 
2Bytesprog2 course_2014_c7_double_lists
2Bytesprog2 course_2014_c7_double_lists2Bytesprog2 course_2014_c7_double_lists
2Bytesprog2 course_2014_c7_double_lists
 
2Bytesprog2 course_2014_c6_single linked list
2Bytesprog2 course_2014_c6_single linked list2Bytesprog2 course_2014_c6_single linked list
2Bytesprog2 course_2014_c6_single linked list
 
2Bytesprog2 course_2014_c5_pointers
2Bytesprog2 course_2014_c5_pointers2Bytesprog2 course_2014_c5_pointers
2Bytesprog2 course_2014_c5_pointers
 
2Bytesprog2 course_2014_c4_binaryfiles
2Bytesprog2 course_2014_c4_binaryfiles2Bytesprog2 course_2014_c4_binaryfiles
2Bytesprog2 course_2014_c4_binaryfiles
 
2Bytesprog2 course_2014_c3_txtfiles
2Bytesprog2 course_2014_c3_txtfiles2Bytesprog2 course_2014_c3_txtfiles
2Bytesprog2 course_2014_c3_txtfiles
 
2Bytesprog2 course_2014_c2_records
2Bytesprog2 course_2014_c2_records2Bytesprog2 course_2014_c2_records
2Bytesprog2 course_2014_c2_records
 
2Bytesprog2 course_2014_c1_sets
2Bytesprog2 course_2014_c1_sets2Bytesprog2 course_2014_c1_sets
2Bytesprog2 course_2014_c1_sets
 
2Bytesprog2 course_2014_c1_sets
2Bytesprog2 course_2014_c1_sets2Bytesprog2 course_2014_c1_sets
2Bytesprog2 course_2014_c1_sets
 
2Bytesprog2 course_2014_c1_sets
2Bytesprog2 course_2014_c1_sets2Bytesprog2 course_2014_c1_sets
2Bytesprog2 course_2014_c1_sets
 
2 BytesC++ course_2014_c13_ templates
2 BytesC++ course_2014_c13_ templates2 BytesC++ course_2014_c13_ templates
2 BytesC++ course_2014_c13_ templates
 
2 BytesC++ course_2014_c12_ polymorphism
2 BytesC++ course_2014_c12_ polymorphism2 BytesC++ course_2014_c12_ polymorphism
2 BytesC++ course_2014_c12_ polymorphism
 
2 BytesC++ course_2014_c11_ inheritance
2 BytesC++ course_2014_c11_ inheritance2 BytesC++ course_2014_c11_ inheritance
2 BytesC++ course_2014_c11_ inheritance
 
2 BytesC++ course_2014_c10_ separate compilation and namespaces
2 BytesC++ course_2014_c10_ separate compilation and namespaces 2 BytesC++ course_2014_c10_ separate compilation and namespaces
2 BytesC++ course_2014_c10_ separate compilation and namespaces
 

Último

DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....ShaimaaMohamedGalal
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 

Último (20)

Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 

2Bytesprog2 course_2014_c1_sets

  • 1. Prog_2 course- 2014 2 bytes team Kinan keshkeh IT Engineering-Damascus University 3rd year
  • 3. Program 2Bytes_pro; Uses wincrt; Var k,x,y,z :integer; Procedure proc1(a:integer; var b:integer ;) var i,x: integer; Begin i:=10; x:=7; y:=12; a:=2; b:=4; end; Begin x:=3; y:=5; proc1(k,z); Writeln(„z=„,z); Writeln(„k=„,k); Writeln(„x=„,x); Writeln(„y=„,y); Writeln(„i=„,i); End. +1 +1 +1 +1 +1 { z=4 } {Random value often be zero} { x=3 } { y=12 } { error }
  • 4. In procedures and functions There are four types of variables : 1.General Variables : are variables that are written at the top of the program befor all procedures and functions and we can see it and deal with it by all procedures and functions in the main program (like : k , x , y , z) . 2.Local Variables : are variables that are declared in the statements part within procedure or function and we can‟t see it and deal with it outside that procedures (like : i , x ) . 3.Formality Variables : are variables that appear in the header of procedure or function and it is formality and is not reserved place for it in memory (like a , b )  we have two types of formality variables 1) input variables : Keeps the value entered by after the completion of the procedural ( like : a) 2)output variables : Keeps the value obtained by the procedure. And we writes before it the reserved word (var) (like : b ) 4.Actual Variables : are variables that main program pass it to procedure or function during a summons and it agree formality variables in number and type (like : k , z)
  • 5. Notes : Local variables have priority from general variables in the same Field of vision ( ايؤرنا لاجي ) ( like : x)  Execution always start form (begin) by the main program  in string : var : name , lname : string ; begin writeln(„enter the name and lname „); readln(name , lname); writeln(name); writeln(lname); End. Ahmed Ali Inputs : Ahmed Ali X nothing outputs name); readln(lname); +1
  • 6. SETS A П B A B
  • 7. What is a DiscreteType?? Discrete Data Type: Integer boolean char Enumerated Day=(sat,sun,mon,tu,wed,th,fri) Like..
  • 8. Definition The SET is a Data Structure which contain discrete type elements .. Doesn‟t have index.!! <Nameof varible > :Set of < discrete type > We can‟t define the set as this form : S : Set of Integer; Because set can have 256 components at most and all its component values should be in rang 0 .. 255 .
  • 9. Ex: •S1 : Set of 1..100; •S2 : Set of „a‟..‟z‟; •S : Set of Days; •S : Set of 66..256; •S: set of char ; {True} {True} {True} {False} +1 {True}
  • 10. Set Handling Var: s1:set of 0..255; S2,s3:set of 40..100; S4:set of „a‟..‟z‟;
  • 11. S1 := [ 55, 80, 99, 80, 600, 41, 44..55]; Isn‟t added S1: 41 44..55 80 99
  • 12. S1 : S1 := [];
  • 13. S2 := [200,20]; S2: 40..100 “NO Change”
  • 15. S4 := [I,k]; Var I,k:integer; i:=1; k:=k+1; +1 S4: Compile Error !!
  • 16. S1 := [I,j]; Var I,j:integer; i:=1; j:=i*9; +1 S1: 1,9
  • 17. i, j : integer; i := 1; j := i-1; S1 := [i, j]; S1 := S1 + [i*2]; S1: 0,1,2 +1
  • 18. S1:=S4; +1 Error Ya fahmaneen !! :D
  • 19. Operation •To put a value in it , we use [value] . •The operations on Sets : ⋂ ⇔ * ⋃ ⇔ + / ⇔ - ⊆ ⇔ <= ⊇ ⇔ >= ∈ ⇔ in
  • 20. Program SetsOperator; Var A0 : set of 1..15; A1 : set of 1..10; A2 : set of 5..15; i : integer; Begin A1 := [1..10]; A2 := [5..15]; A0 := A1*A2; {A0=[5..10]} A0 := A1+A2; {A0=[1..15]} A0 := A1-A2; {A0=[1..4]} A0 := A0-[1]; {A0=[2..4]}
  • 21. A1 := [2,3]; A2 := [1,2,3,4,5]; if (A1 <= A2) then {or (A2 >= A1)} writeln ('A1 is a subset of A2'); readln (i); if (i in A1) then writeln (i,' is in A1') else writeln (i,' is not in A1'); End;
  • 22. True statement A0, A1 : Set of 1..15; A : boolean; A0 := [1, 2]; A1 := [2, 4]; A0 := A0 – [77]; A := A1 >= A0; A := 1 in A0;
  • 23. Const Sets Type Digits = set of 0..9; Const HexD : set of '0'..'z‘ = ['0'..'9', 'A'..'F', 'a'..'f']; ED : Digits = [0, 2, 4, 6, 8]; Var d : Digits; Begin d := [8]; d := ED; {d=[0,2,4,6,8]} ED:=ED+[9]; ED:=d; End. +1 Error .. Fateh 3eoonk !!
  • 24. Enum Set Type Day = (sun,mon,….,sat); Name=(koko,soso,fofo,fifi); Var days: Set of Day; N:set of Name Begin Days:=[sun..sat]; N:=[KOKO,SOSO]; End.
  • 25. Read & Print Sets :
  • 26. Program Test(); Type SInt = Set of 1..150 ; SCh = Set of ‘0’..’z’; Var S1 : SInt; S2 : SCh; Slen : Integer; Begin Readln(Slen); ReadsetI(S1 , Slen); ReadsetC(S2 , Slen); PrintsetI(S1 , Slen); PrintsetC(S2 , Slen); Readln; End.
  • 27. Read Integer Sets Procedure ReadsetI (var S:SInt; L:integer) ; var i, x : integer; Begin s:=[]; For i:=1 to L do begin Read(x); S := S + [x]; end; End;
  • 28. Read Char Sets Procedure ReadsetC (var S:SCh; L:integer) ; var i, x : Char; Begin s:=[]; For i:=1 to L do begin Read(x); S := S + [x]; end; End;
  • 29. Print Integer Sets Using While Loop: Procedure PrintsetI (S : SInt) ; var I : Integer; Begin I := 0; While ( S <> []) do If (I in S) then begin Writeln(I); S := S – [I]; end; I := I + 1; End;
  • 30. Print Integer Sets Using For Loop Procedure PrintsetI (S : SI) ; var I : Integer; Begin For I:=1 to 32700 do Begin If (I in S) then Begin Writeln(I); S := S – [I]; End; If (S = []) then I := 32700; End; End;
  • 31. Exercise : يرى في يؼهذ يا إػطاء دوراخ في يادذي انرياضياخ وانهغح الإ كَهيسيح يؼطى كم طانة ػ ذُ ذسجيهه في ان ؼًهذ رقى فريذ يحصىر تي 1..100 فإرا ػه دً أ ػذد انطلاب في كم يادج لا يرجاوز 50 طانة ان طًهىب كراتح تر اَيج ػاو تاسرخذاو الاجرائياخ وان جً ىًػاخ ورنك نهقياو تان هًاو انرانيح : . 1 ذشكيم يج ىًػح نطلاب انرياضياخ ويج ىًػح نطلاب انهغح الإ كَهيسيح )إدخال ػ اُصر ان جً ىًػح ( . 2 إجراء نطثاػح ػ اُصر ان جً ىًػح . 3 إجراء لإػطاء يج ىًػح تأرقاو انطلاب ان سًجهي تان اًدذي . 4 قررخ إدارج ان ؼًهذ ذخفيض ػذد انطلاب ورنك تالاسرغ اُء ػ ػذد يحذد ي هُى يذخم ي نىحح ان فًاذيح ػهى أ يرى اخريار أرقاو انطلاب ان فًصىني تشكم ػشىائي وان طًهىب كراتح إجراء ن قُم أرقاو انطلاب ان فًصىني إنى يج ىًػح جذيذج . 5 وضغ أرقاو انطلاب ان فًصىني ض شؼاع
  • 32. Program prog2byte_team; Uses wincrt; Type students=set of 1..100; numbers=array[1..50] of 1..100; Var seng,smath : students; Procedure inputset(var s : students; m:integer); Var i,x: integer; Begin s:=[ ]; i:=0; While (i<m) do begin writeln(„input students number „); readln(x); if (x in s) then writeln(„ you input this number befor please enter another number „) else begin i:=i+1; s:=s+[x]; end; end; End; numbers of students
  • 33. Procedure printset(s :students); Var i:integer; Begin i:=1; While (s<>[ ]) do begin if (i in s) then begin write(i:5); s:=s-[ i ]; end; i:=i+1; end; writeln; End;
  • 34. Procedure bothsub(s1,s2 : students; var s3: students); Begin s3:=s1*s2; End;
  • 35. Procedure deletestd(var s,n : students); Var k,i,x ; integer; Begin n:= [ ]; Randomize; i:=0; Writeln(„enter the number you want to go throw out „); Readln(x); While (i<x) do begin k:= random(100) + 1; if ( k in s ) then begin s:=s – [ k ]; seng:= seng – [ k ]; smath:=smath – [ k ]; i:=i+1; n:=n + [ k ]; end; end; End; بلاطنا حػىًجي ان فًصىني يج ىًػح انرقاطغ :Randomize يقىو ترىنيذ أرقاو ػشىائيح أػر اًدا ػهى ساػح ان ظُاو :Random(100)=0..99; Random(100)+1=1..100
  • 36. Procedure setinArray(s: students; var a: numbers ; var k: integer); Var i : integer; Begin K:=0; For i:=1 to 100 do If (i in s) then begin k:=k+1; a[k]:=i; end; End; ي أجم اسرذػاء انشؼاع في انثر اَيج انرئيسي
  • 37. Var nmath,neng,k,i :integer; Aunaccepted : numbers; Sunaccepted,sboth : students; Begin Writeln(„enter the number of math students „); Readln(nmath); Inputset(smath,nmath); Writeln(„enter the number of English students „); Readln(neng); Inputset(seng,neng); Bothsub(smath , seng , sboth); Printset(sboth); Deletestd(sboth,Sunaccepted); Printset(Sunaccepted); setinArray(Sunaccepted,Aunaccepted,k); For i:=1 to k do Writeln(Aunaccepted[i]:5); Readln; End.
  • 38. Homework: Creat and read two arrays of student numbers, student numbers in Prog and in English. -We want to know the students numbers at the two subjects..?! -what are the student numbers at the Prog and Not at English ?? +10 point
  • 39. Group : group link Mobile phone- Kinan : 0994385748 Facebook account : kinan’s account 2 bytes team
  • 41. Ques: write a programme DO: 1-Read An Array 2-Print An Array//Proce 3-function to find the min elem in the array 4-Procedure to find the Sum array(of the tow arrays). 5- Multi array Write the Main Program..
  • 42. Programme P-Matrix; Const nMax=20; mMax=20; Type Matrix=array[1..nmax,1..mmax] of real; Var A,B,Add,mult :Matrix; n1,n2 :1..nmax; m1,m2 :1..mmax; min: integer;
  • 43. Procedure ReadMat(Var: n:1..nmax;var m:1..mmax; var A:matrix); Var i,j:integer; begin writeln(„enter the first Dimention of matrix< ‟ ,nmax); Readln(n); writeln(„enter the second Dimention of matrix< ‟ ,mmax); Readln(m); for i:=1 to n do begin for j:=1 to m do read(A[I,j]); {hint} readln; {hint} end; end;
  • 44. Procedure WriteMat(Var: n:1..nmax;var m:1..mmax; var A:matrix); Var i,j:integer; begin for i:=1 to n do begin for j:=1 to m do write(A[i,j],‟ ‟); writeln; end; end;
  • 45. Function MinOfMatrix(n:1..nmax,m:1..mmax;A:matrix):real Var i,j:integer; min:real; begin min:=A[1,1]; For i:=1 to n do for j:=1 to m do if (A[i,j]<min) then min:=A[i,j]; MinOfMatrix:=min; end;
  • 46. Procedure Add_Tow_Matrix(n1,n2:1..nmax; m1,m2:1..mmax; var n3:1..nmax; var m3:1..mmax; var c:Matrix); Var i,j:integer; begin if(n1<>n2)or(m1<>m2) then writeln(„the addition is impossible‟); else begin n3:=n1; m3:=m1; for i:=1 to n3 do for j:=1 to m3 do C[i.j]:=A[i,j]+B[i,j]; end; end;
  • 47. Procedure Mult_Tow_Matrix(n1,n2:1..nmax; m1,m2:1..mmax; var n3:1..nmax; var m3:1..mmax; var c:Matrix); Var i,j,k:integer; begin if(n1<>m2) then writeln(„the multi is impossible‟); else begin n3:=n2; m3:=m1; { A(m1,n1)*B(m2,n2)=C(m3,n3)} for i:=1 to n3 do for j:=1 to m3 do begin C[i,j]=0; for k:=1 to m2 C[i.j]:= C[i.j] +A[i,k]*B[k,j]; end; end; end;
  • 48. Begin ReadMat(n1,m1,A); WriteMat(n1,m1,A); ReadMat(n2,m2,B); WriteMat(n2,m2,B); writeln(„the minimum of the first Mat = ‟); min:=MinOfMatrix(n1,m1,A); writeln(min); Add_Tow_Matrix(n1.m1,n2,m2,A,B,n3,m3,Add); WriteMat(n3,m3,Add); Mult_Tow_Matrix(n1,n2,m1,m2,A,B, n3,m3,mult); WriteMat(n3,m3,mult); End;
  • 49. Group : group link Mobile phone- Kinan : 0994385748 Facebook account : kinan’s account 2 bytes team