SlideShare a Scribd company logo
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.
Records c2
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

PDF
Look up
MyWonderStudio
 
DOCX
Consumer behavior assignment
Shams Chowdhury
 
PPTX
Pascal
AAPerevalova
 
PPT
Hello world pascal tutorial
Serghei Urban
 
PDF
Sets c1
Omar Al-Sabek
 
PPTX
Files c3
Omar Al-Sabek
 
PDF
Programming paradigms c1
Omar Al-Sabek
 
PPTX
Pascal Programming Language
Reham AlBlehid
 
Consumer behavior assignment
Shams Chowdhury
 
Pascal
AAPerevalova
 
Hello world pascal tutorial
Serghei Urban
 
Sets c1
Omar Al-Sabek
 
Files c3
Omar Al-Sabek
 
Programming paradigms c1
Omar Al-Sabek
 
Pascal Programming Language
Reham AlBlehid
 

More from Omar Al-Sabek (14)

PPTX
Google Big Table
Omar Al-Sabek
 
PDF
Online Certificate Data Mining with Weka
Omar Al-Sabek
 
PDF
Agile Methodology
Omar Al-Sabek
 
PPTX
E payment Project Demo
Omar Al-Sabek
 
PPTX
A petri-net
Omar Al-Sabek
 
PPTX
Files c4
Omar Al-Sabek
 
PDF
Pointers c5
Omar Al-Sabek
 
PDF
Stack c6
Omar Al-Sabek
 
PDF
Linked lists c7
Omar Al-Sabek
 
PDF
Double linked list c8
Omar Al-Sabek
 
PDF
Function procedure c6 c7
Omar Al-Sabek
 
PDF
Control structures c2 c3
Omar Al-Sabek
 
PDF
Arrays c4 c5
Omar Al-Sabek
 
Google Big Table
Omar Al-Sabek
 
Online Certificate Data Mining with Weka
Omar Al-Sabek
 
Agile Methodology
Omar Al-Sabek
 
E payment Project Demo
Omar Al-Sabek
 
A petri-net
Omar Al-Sabek
 
Files c4
Omar Al-Sabek
 
Pointers c5
Omar Al-Sabek
 
Stack c6
Omar Al-Sabek
 
Linked lists c7
Omar Al-Sabek
 
Double linked list c8
Omar Al-Sabek
 
Function procedure c6 c7
Omar Al-Sabek
 
Control structures c2 c3
Omar Al-Sabek
 
Arrays c4 c5
Omar Al-Sabek
 
Ad

Recently uploaded (20)

PPTX
HISTORY COLLECTION FOR PSYCHIATRIC PATIENTS.pptx
PoojaSen20
 
PPTX
An introduction to Dialogue writing.pptx
drsiddhantnagine
 
PPTX
Continental Accounting in Odoo 18 - Odoo Slides
Celine George
 
PPTX
Five Point Someone – Chetan Bhagat | Book Summary & Analysis by Bhupesh Kushwaha
Bhupesh Kushwaha
 
DOCX
pgdei-UNIT -V Neurological Disorders & developmental disabilities
JELLA VISHNU DURGA PRASAD
 
PPTX
Kanban Cards _ Mass Action in Odoo 18.2 - Odoo Slides
Celine George
 
PPTX
PROTIEN ENERGY MALNUTRITION: NURSING MANAGEMENT.pptx
PRADEEP ABOTHU
 
PPTX
Tips Management in Odoo 18 POS - Odoo Slides
Celine George
 
PDF
Health-The-Ultimate-Treasure (1).pdf/8th class science curiosity /samyans edu...
Sandeep Swamy
 
PDF
The-Invisible-Living-World-Beyond-Our-Naked-Eye chapter 2.pdf/8th science cur...
Sandeep Swamy
 
PPTX
Care of patients with elImination deviation.pptx
AneetaSharma15
 
PPTX
HEALTH CARE DELIVERY SYSTEM - UNIT 2 - GNM 3RD YEAR.pptx
Priyanshu Anand
 
PPTX
INTESTINALPARASITES OR WORM INFESTATIONS.pptx
PRADEEP ABOTHU
 
PPTX
Measures_of_location_-_Averages_and__percentiles_by_DR SURYA K.pptx
Surya Ganesh
 
PPTX
How to Apply for a Job From Odoo 18 Website
Celine George
 
PPTX
CARE OF UNCONSCIOUS PATIENTS .pptx
AneetaSharma15
 
PPTX
Information Texts_Infographic on Forgetting Curve.pptx
Tata Sevilla
 
PPTX
How to Manage Leads in Odoo 18 CRM - Odoo Slides
Celine George
 
PDF
Review of Related Literature & Studies.pdf
Thelma Villaflores
 
PPTX
Cleaning Validation Ppt Pharmaceutical validation
Ms. Ashatai Patil
 
HISTORY COLLECTION FOR PSYCHIATRIC PATIENTS.pptx
PoojaSen20
 
An introduction to Dialogue writing.pptx
drsiddhantnagine
 
Continental Accounting in Odoo 18 - Odoo Slides
Celine George
 
Five Point Someone – Chetan Bhagat | Book Summary & Analysis by Bhupesh Kushwaha
Bhupesh Kushwaha
 
pgdei-UNIT -V Neurological Disorders & developmental disabilities
JELLA VISHNU DURGA PRASAD
 
Kanban Cards _ Mass Action in Odoo 18.2 - Odoo Slides
Celine George
 
PROTIEN ENERGY MALNUTRITION: NURSING MANAGEMENT.pptx
PRADEEP ABOTHU
 
Tips Management in Odoo 18 POS - Odoo Slides
Celine George
 
Health-The-Ultimate-Treasure (1).pdf/8th class science curiosity /samyans edu...
Sandeep Swamy
 
The-Invisible-Living-World-Beyond-Our-Naked-Eye chapter 2.pdf/8th science cur...
Sandeep Swamy
 
Care of patients with elImination deviation.pptx
AneetaSharma15
 
HEALTH CARE DELIVERY SYSTEM - UNIT 2 - GNM 3RD YEAR.pptx
Priyanshu Anand
 
INTESTINALPARASITES OR WORM INFESTATIONS.pptx
PRADEEP ABOTHU
 
Measures_of_location_-_Averages_and__percentiles_by_DR SURYA K.pptx
Surya Ganesh
 
How to Apply for a Job From Odoo 18 Website
Celine George
 
CARE OF UNCONSCIOUS PATIENTS .pptx
AneetaSharma15
 
Information Texts_Infographic on Forgetting Curve.pptx
Tata Sevilla
 
How to Manage Leads in Odoo 18 CRM - Odoo Slides
Celine George
 
Review of Related Literature & Studies.pdf
Thelma Villaflores
 
Cleaning Validation Ppt Pharmaceutical validation
Ms. Ashatai Patil
 
Ad

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.
  • 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-‫الرحلة‬ ‫في‬ ‫ايابا‬ ‫و‬ ‫ذهابا‬ ‫حجزها‬ ‫تم‬ ‫التي‬ ‫المقاعد‬ ‫ارقام‬ ‫مجموعة‬ ‫طباعة‬ 