SlideShare a Scribd company logo
1 of 24
Download to read offline
Pascal Programming Language
Omar ElSabek & Fayez Ghazzawi
IT Engineering
3th year – UNKNOWN Department
programming II
Sets
 Record
Files (Text & Binary)
Pointers
 Linked Lists
 Unit
Course Index :
• Let’s Begin learning the RECORDS
Program Test();
Var
First_name : array [1..100] of String;
Last_name : array [1..100] of String;
Age : array [1..100] of Integer;
Day : array [1..100] of Integer;
Month : array [1..100] of Integer;
year : array [1..100] of Integer;
i,n : Integer;
Begin
Readln(n);
For i:=1 to n do
Read(First_name[i],Last_name[i],Age[i],Day[i],Month[i],year[i]);
Readln;
End.
OMG !!
Record
A record is a special type of data structure that, unlike arrays,
collects different data types that define a particular structure such
as a book, product, person and many others. Which defines the
data structure under the Type user definition.
How we Define it ?
type
record-name = record
field-1: field-type1;
field-2: field-type2;
...
end ;
What Data type it can content ?
Simple DataType
Integer
Real
Char
String
Boolean
What Data type it can content ?
complex object
Date (D,M,Y)
Time (H,M,S)
Rectangle (L,W)
Employee (….)
…
multi arrays for multi data type
Examples:
program exRecords;
type
Books = record
title: String [30];
author: String [30];
subject: String [30];
book_id: longint;
end;
var
Book1, Book2: Books;
begin
(* book 1 specification *)
Book1.title := 'C Programming';
Book1.author := 'Nuha Ali ';
Book1.subject := 'C Programming Tutorial';
Book1.book_id := 6495407;
(* book 2 specification *)
Book2.title := 'Telecom Billing';
Book2.author := 'Zara Ali';
Book2.subject := 'Telecom Billing Tutorial';
Book2.book_id := 6495700;
writeln ('Book 1 title : ', Book1.title);
writeln('Book 1 author : ', Book1.author);
writeln( 'Book 1 subject : ', Book1.subject);
writeln( 'Book 1 book_id : ', Book1.book_id);
writeln;
(* print Book2 info *)
writeln ('Book 2 title : ', Book2.title);
writeln('Book 2 author : ', Book2.author);
writeln( 'Book 2 subject : ', Book2.subject);
writeln( 'Book 2 book_id : ', Book2.book_id);
end.
Type
Date = Record
Day, month, year : Integer;
End;
STD = Record
First_name : string[20];
Last_name : String[20];
Age : Real;
DODO : Date;
End;
STD
DODO
F
N
A
M
E
L
N
A
M
E
A
g
e
D M Y
Var
x,y : STD;
A : array [1..100] of STD;
I : integer;
x.First_name
A[i].First_name
A[i].Age
A[i].DODO.Day
x.
First_name
Last_name
DODO.
Age
Year
Month
Day
For I:=1 to 100 do
Begin
Readln(A[I].First_name);
Readln(A[I].Last_name);
Readln(A[I].Age);
Readln(A[I].Date.year);
Readln(A[I].Date.Month);
Readln(A[I].Date.Day);
End;
It is using for accessing record fields directly
without [dot] operator
Accessing fields
without [dot]
With X do
Begin
Readln(First_name);
Readln(Last_name);
Readln(Age);
With Date do
Begin
Readln(year);
Readln(Month);
Readln(Day);
End;
End;

‫طائرة‬ ‫بيانات‬ ‫طيران‬ ‫شركة‬ ‫موظف‬ ‫يدخل‬ ‫برنامج‬ ‫كتابة‬:
‫الطائرة‬ ‫في‬ ‫المقاعد‬ ‫عدد‬ ‫اوال‬ ‫يحدد‬
‫تتضمن‬ ‫والتي‬ ‫الحجوزات‬ ‫بيانات‬ ‫ادخال‬ ‫ب‬ ‫يقوم‬ ‫ثم‬:
1-‫المقعد‬ ‫رقم‬2-‫التذكرة‬ ‫حامل‬ ‫اسم‬3-‫الكنية‬
4-‫الرحلة‬ ‫موعد‬5-‫االولى‬ ‫الدرجة‬ ‫من‬ ‫المقعدد‬ ‫هل‬ ‫تحدد‬ ‫منطقية‬ ‫قيمة‬
(‫اياب‬ ‫و‬ ‫ذهاب‬ ‫الرحلة‬ ‫الن‬ ‫مرتيين‬ ‫البيانات‬ ‫ادخال‬ ‫يتم‬)
‫المطلوب‬:
1-‫ايابا‬ ‫و‬ ‫ذهابا‬ ‫الطائرة‬ ‫سجالت‬ ‫ملئ‬ ‫اجرائية‬
2-‫الطائرة‬ ‫سجالت‬ ‫عرض‬ ‫اجرائية‬
3-‫الرقم‬ ‫حسب‬ ‫مقعد‬ ‫معلومات‬ ‫طباعة‬ ‫و‬ ‫بحث‬ ‫اجرائية‬
‫المطلوب‬:
1-‫ايابا‬ ‫و‬ ‫ذهابا‬ ‫الطائرة‬ ‫سجالت‬ ‫ملئ‬ ‫اجرائية‬
2-‫الطائرة‬ ‫سجالت‬ ‫عرض‬ ‫اجرائية‬
3-‫الرقم‬ ‫حسب‬ ‫مقعد‬ ‫معلومات‬ ‫طباعة‬ ‫و‬ ‫بحث‬ ‫اجرائية‬
4-‫المقعد‬ ‫رقم‬ ‫حسب‬ ‫الطائرة‬ ‫سجل‬ ‫ترتيب‬
5-‫الرحلة‬ ‫في‬ ‫ايابا‬ ‫و‬ ‫ذهابا‬ ‫حجزها‬ ‫تم‬ ‫التي‬ ‫المقاعد‬ ‫ارقام‬ ‫مجموعة‬ ‫طباعة‬

Records c2

More Related Content

More from Omar Al-Sabek

More from Omar Al-Sabek (14)

Google Big Table
Google Big TableGoogle Big Table
Google Big Table
 
Online Certificate Data Mining with Weka
Online Certificate Data Mining with WekaOnline Certificate Data Mining with Weka
Online Certificate Data Mining with Weka
 
Agile Methodology
Agile MethodologyAgile Methodology
Agile Methodology
 
Git
GitGit
Git
 
E payment Project Demo
E payment Project DemoE payment Project Demo
E payment Project Demo
 
A petri-net
A petri-netA petri-net
A petri-net
 
Files c4
Files c4Files c4
Files c4
 
Pointers c5
Pointers c5Pointers c5
Pointers c5
 
Stack c6
Stack c6Stack c6
Stack c6
 
Linked lists c7
Linked lists c7Linked lists c7
Linked lists c7
 
Double linked list c8
Double linked list c8Double linked list c8
Double linked list c8
 
Function procedure c6 c7
Function procedure  c6 c7Function procedure  c6 c7
Function procedure c6 c7
 
Control structures c2 c3
Control structures c2 c3Control structures c2 c3
Control structures c2 c3
 
Arrays c4 c5
Arrays c4 c5Arrays c4 c5
Arrays c4 c5
 

Recently uploaded

call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxMaryGraceBautista27
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptxiammrhaywood
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Seán Kennedy
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 

Recently uploaded (20)

call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptx
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 

Records c2

  • 1. Pascal Programming Language Omar ElSabek & Fayez Ghazzawi IT Engineering 3th year – UNKNOWN Department programming II
  • 2. Sets  Record Files (Text & Binary) Pointers  Linked Lists  Unit Course Index :
  • 3. • Let’s Begin learning the RECORDS
  • 4. Program Test(); Var First_name : array [1..100] of String; Last_name : array [1..100] of String; Age : array [1..100] of Integer; Day : array [1..100] of Integer; Month : array [1..100] of Integer; year : array [1..100] of Integer; i,n : Integer; Begin Readln(n); For i:=1 to n do Read(First_name[i],Last_name[i],Age[i],Day[i],Month[i],year[i]); Readln; End. OMG !!
  • 5. Record A record is a special type of data structure that, unlike arrays, collects different data types that define a particular structure such as a book, product, person and many others. Which defines the data structure under the Type user definition.
  • 6. How we Define it ? type record-name = record field-1: field-type1; field-2: field-type2; ... end ;
  • 7. What Data type it can content ? Simple DataType Integer Real Char String Boolean
  • 8. What Data type it can content ? complex object Date (D,M,Y) Time (H,M,S) Rectangle (L,W) Employee (….) … multi arrays for multi data type
  • 10. program exRecords; type Books = record title: String [30]; author: String [30]; subject: String [30]; book_id: longint; end;
  • 11. var Book1, Book2: Books; begin (* book 1 specification *) Book1.title := 'C Programming'; Book1.author := 'Nuha Ali '; Book1.subject := 'C Programming Tutorial'; Book1.book_id := 6495407;
  • 12. (* book 2 specification *) Book2.title := 'Telecom Billing'; Book2.author := 'Zara Ali'; Book2.subject := 'Telecom Billing Tutorial'; Book2.book_id := 6495700; writeln ('Book 1 title : ', Book1.title); writeln('Book 1 author : ', Book1.author); writeln( 'Book 1 subject : ', Book1.subject); writeln( 'Book 1 book_id : ', Book1.book_id); writeln;
  • 13. (* print Book2 info *) writeln ('Book 2 title : ', Book2.title); writeln('Book 2 author : ', Book2.author); writeln( 'Book 2 subject : ', Book2.subject); writeln( 'Book 2 book_id : ', Book2.book_id); end.
  • 14.
  • 15. Type Date = Record Day, month, year : Integer; End; STD = Record First_name : string[20]; Last_name : String[20]; Age : Real; DODO : Date; End; STD DODO F N A M E L N A M E A g e D M Y
  • 16. Var x,y : STD; A : array [1..100] of STD; I : integer;
  • 19. For I:=1 to 100 do Begin Readln(A[I].First_name); Readln(A[I].Last_name); Readln(A[I].Age); Readln(A[I].Date.year); Readln(A[I].Date.Month); Readln(A[I].Date.Day); End;
  • 20. It is using for accessing record fields directly without [dot] operator Accessing fields without [dot]
  • 21. With X do Begin Readln(First_name); Readln(Last_name); Readln(Age); With Date do Begin Readln(year); Readln(Month); Readln(Day); End; End;
  • 22.  ‫طائرة‬ ‫بيانات‬ ‫طيران‬ ‫شركة‬ ‫موظف‬ ‫يدخل‬ ‫برنامج‬ ‫كتابة‬: ‫الطائرة‬ ‫في‬ ‫المقاعد‬ ‫عدد‬ ‫اوال‬ ‫يحدد‬ ‫تتضمن‬ ‫والتي‬ ‫الحجوزات‬ ‫بيانات‬ ‫ادخال‬ ‫ب‬ ‫يقوم‬ ‫ثم‬: 1-‫المقعد‬ ‫رقم‬2-‫التذكرة‬ ‫حامل‬ ‫اسم‬3-‫الكنية‬ 4-‫الرحلة‬ ‫موعد‬5-‫االولى‬ ‫الدرجة‬ ‫من‬ ‫المقعدد‬ ‫هل‬ ‫تحدد‬ ‫منطقية‬ ‫قيمة‬ (‫اياب‬ ‫و‬ ‫ذهاب‬ ‫الرحلة‬ ‫الن‬ ‫مرتيين‬ ‫البيانات‬ ‫ادخال‬ ‫يتم‬) ‫المطلوب‬: 1-‫ايابا‬ ‫و‬ ‫ذهابا‬ ‫الطائرة‬ ‫سجالت‬ ‫ملئ‬ ‫اجرائية‬ 2-‫الطائرة‬ ‫سجالت‬ ‫عرض‬ ‫اجرائية‬ 3-‫الرقم‬ ‫حسب‬ ‫مقعد‬ ‫معلومات‬ ‫طباعة‬ ‫و‬ ‫بحث‬ ‫اجرائية‬
  • 23. ‫المطلوب‬: 1-‫ايابا‬ ‫و‬ ‫ذهابا‬ ‫الطائرة‬ ‫سجالت‬ ‫ملئ‬ ‫اجرائية‬ 2-‫الطائرة‬ ‫سجالت‬ ‫عرض‬ ‫اجرائية‬ 3-‫الرقم‬ ‫حسب‬ ‫مقعد‬ ‫معلومات‬ ‫طباعة‬ ‫و‬ ‫بحث‬ ‫اجرائية‬ 4-‫المقعد‬ ‫رقم‬ ‫حسب‬ ‫الطائرة‬ ‫سجل‬ ‫ترتيب‬ 5-‫الرحلة‬ ‫في‬ ‫ايابا‬ ‫و‬ ‫ذهابا‬ ‫حجزها‬ ‫تم‬ ‫التي‬ ‫المقاعد‬ ‫ارقام‬ ‫مجموعة‬ ‫طباعة‬ 