SlideShare a Scribd company logo
1 of 26
CHAPTER 3 : DESCRIPTION OF
DATA
Chapter Objectives
At the completion of this chapter, you would have
learnt:
 the different types of data;
 the different types of data structures.
Introduction
 Data is any collection of numbers, characters or
other symbols that has been coded into a format
that can be input into a computer and processed.
 The main function of a computer program is to
process data to produce information.
That is, to accept data from the user as
input, process the data and
present the information to the user as
output
3.1 Types of Data
There are two fundamental types of data: Numeric
and Non-numeric.
 Numeric(Qualitative)
Numbers used for sums of money, ages,
distances.
For example 0.33, -0.1, 0.5, 2, 50.01, -100, etc.
 Non-Numeric(Quantitative)
Non numbers such as strings of characters.
For example ‘John’, ‘AS1234G’ and ‘2@**556’,
etc.
DATA DIAGRAM
Data
Numeric
Non
Numeric
Char String Logical Pointer DatesInteger Real
3.1.1 Numeric
Divided into two main groups: Integer and Real.
 Integer
 Whole numbers used to count things,
example 1, 2, 3,...
 Count discrete objects such as number of
bananas, orange or pencils.
 Precise values.
 The range of integers provided in a
computer system depends on the
hardware/language used.
 REAL
 May have a fractional part, example 1.0,
234.66, ...
 Can be positive or negative.
 To measure things like the length of a
piece of string, or the cost of an item in
dollars and cents.
 Generally NOT a precise value.
 Nearest value is according to the method
of storage and type of arithmetic used
(e.g. for rounding off method, 14.385 in
this case will become 14.39 and 14.382
will become 14.38 whereas for truncation
to two decimal places both 14.385 and
14.382 will become 14.38).
3.1.2 Non-Numeric
1. Character strings
Character strings may consist of
Numbers, Alphabets or
Alphanumeric.
To represent such character strings,
quotes (’) are needed. For example
the name JAMES will need to be
quoted as ‘JAMES’.
2. String
 String characters are stored as codes using
the American Standard Code for Information
Interchange (ASCII) or Extended Binary
Coded Decimal Interchange Code (EBCDIC)
code system.
 String operation usually involves comparison,
concatenation or selection to allow
combinations of strings. Thus strings should
have different values also. For example,
‘A’ < ‘Z’,
‘ABC’ > ‘AAA’
‘Alpha’ < ‘Alphabet’ and
lowercase characters > Uppercase
characters
3.Logical / Boolean data
 Consists of 2 values: True or False.
4.Pointers
 which store the address of variables.
5. Dates
 which allow arithmetic operation on
calendar dates.
3.1.3 Identifiers
 All data items used in a program need to
be declared before usage. This means
to state down the name given to each
data item storage cell known as
“identifier”.
An identifier may be numeric or non-
numeric.
The data type that can be contained
in the storage cell will depend on the
declaration of the cell.
These storage cells can be a constant storage cell or
variable storage cell.
 Constants
It is a “Read-only” variable which
contains fixed data values that cannot be
changed during the program execution.
 Variables
Their content changes according to the
users input or the processing of the
program during execution.
3.2 Types of Data Structure
 Data items grouped logically together to give
information about an individual.
 For example, an address book is a data structure
containing data items (names, addresses, phone
numbers etc.).
3.2.1 Arrays and Tables
3.2.2 Structured Diagrams
3.2.3 Static vs. Dynamic Data Structure
3.2.4 Files, Records and Fields
3.2.1 Arrays and Tables
 An array is a sequence of consecutive storage
locations having a common name.
 Refer to the contents of the storage cells of each array
element by a “subscript” or “index” which is enclosed
with a square bracket, e.g. [1], [5,3] or [counter].
 Grouping of variables in an array of several elements.
 For example, a one-dimensional array that stored 6
test marks of a student. This array is called
‘StudentFile’.
 StudentFile
76 77 78 56 89 90
0 1 2 3 4 5
 The value in each of the box stores a test mark.
 Refer to the contents of the storage cell of each array
element by a “subscript” or “index”. For example, to refer
to the test mark in box number 3, what you will need to
do is to call the array by its name, followed by the
“subscript” or “index” shown below it. In this case, you
can refer to the contents of box number 3 by calling
“StudentFile[3]”.
 A one dimensional array can only hold a student’s test
marks in this case, so if a data structure that is
supposed to be created to store all the test marks of a
class of students, a two dimensional array must be
used.
 A two dimensional array is a table that can store more
information. An example is shown on the next page.
A two-dimensional array that stores 6 tests marks of
3 students.
StudentFile
In this case, you can refer to the content of the third box
in the first row by calling “StudentFile[1,3]”.
1 76 77 78 56 89 90
2 76 89 87 47 85 58
3 56 34 78 67 98 76
1 2 3 4 5 6
3.2.2 Structured Diagrams
 To show the grouping and relationship of data items in
a real case in pictorial form, we can use data structure
diagrams.
Characteristics of a Structured Diagram
 Shows how to sub-divide a data item into its parts
using the three data structure constructs.
Three Data Structure Constructs
Simple elements such as address can be represented
with a rectangle box.
1. Sequence Construction
2. Selection Construction
3. Repetition/Iteration Construction
Address
Three Data Structure Constructs
 Simple with lower level - To show its contents more
clearly, it is sub-divided into different parts shown at the
lower level in the following diagrams.
Address
Street Name Postal CodeHouse Number
(Sequence
construct)
(Selection
construct)
CAR
SALOON ESTATESPORTS
O O O
Note: If one element connected upwards is a selection, all
elements connected up to the same point must be
selections.
Only one selection will be made regardless of the
number of choices.
Example:
(Repetition / Iteration
construct)
Main
Process EndIntro
*
Data Structure on an Address Book
FILE
RECORD TRAILERHEADER
*
ADDRESS TELEPHONENAME
INITIALSSURNAME UNIT-CODEAREA CODE
STREET TOWNHOUSE
NAMENUMBER
oo
3.2.3 Static vs. Dynamic Data
Structure
 “STATIC” data structure - the size of the data structure
needed to store information CANNOT change as the
program runs. E.g. array.
 “DYNAMIC” data structure - the size of the data
structure needed to store information CAN change as
the program runs. E.g. linked list.
 Each member of the list essentially forms a record in
the list.
 Each member record is linked to the NEXT LOGICAL
RECORD by means of a special field within the record
called a POINTER.
 The POINTER field contains the address of the next
logical record in the list.
Note: Not all languages have linked lists.
Types of linked lists are
 Binary tree
 Ring
Start point
3.2.4Files, Records and Fields
 File
A file is defined as a group of related data
records handled as a logical unit.
For example, the stock master file contains
data records of all stock items in the
warehouse, the payroll master file contains
data records of all employees currently on
the payroll of the organisation.
 Record
A record is defined as a group of related
data items called fields, forming a logical unit.
For example, the stock master record may
contain data items like ITEM-CODE,
DESCRIPTION, UNIT-PRICE, QUANTITY-ON-
HAND and so on. These data items make up
the stock master record, and they are called
FIELDS.
 Field
A field is a data item forming a subdivision
of a record.
Record
no. 1
Student
Number
Student
Name
Date of
Birth
Sex Exam
Mark
1289
Cindy
Bridges
080471 F 76
1290
Alan Lim 060970 M 80
Record
no. 1
Record
no. 2
File
Fields
 Record key
Definition
A record key is defined as a field within a
record that is used as the basis for ordering
the records in a sequential file and also as a
means of direct access.
Examples
STOCK MASTER file arranged in ascending
order of item code which is the record key that
must be unique.
SUPPLIER MASTER field arranged in order of
vendor number, which is the record key.

More Related Content

What's hot

What's hot (20)

Normalisation - 2nd normal form
Normalisation - 2nd normal formNormalisation - 2nd normal form
Normalisation - 2nd normal form
 
Data mining fp growth
Data mining fp growthData mining fp growth
Data mining fp growth
 
INFORMATION RETRIEVAL ‎AND DISSEMINATION
INFORMATION RETRIEVAL ‎AND DISSEMINATIONINFORMATION RETRIEVAL ‎AND DISSEMINATION
INFORMATION RETRIEVAL ‎AND DISSEMINATION
 
Data Redundancy & Update Anomalies
Data Redundancy & Update AnomaliesData Redundancy & Update Anomalies
Data Redundancy & Update Anomalies
 
Classification Algorithm.
Classification Algorithm.Classification Algorithm.
Classification Algorithm.
 
Information Retrieval Evaluation
Information Retrieval EvaluationInformation Retrieval Evaluation
Information Retrieval Evaluation
 
UNIVERSAL DECIMAL CLASSIFICATION-UDC
UNIVERSAL DECIMAL CLASSIFICATION-UDCUNIVERSAL DECIMAL CLASSIFICATION-UDC
UNIVERSAL DECIMAL CLASSIFICATION-UDC
 
Fp growth
Fp growthFp growth
Fp growth
 
Dimensionality Reduction and feature extraction.pptx
Dimensionality Reduction and feature extraction.pptxDimensionality Reduction and feature extraction.pptx
Dimensionality Reduction and feature extraction.pptx
 
Classification a review
Classification   a reviewClassification   a review
Classification a review
 
Normalisation muzz
Normalisation muzzNormalisation muzz
Normalisation muzz
 
Interval data
Interval dataInterval data
Interval data
 
Text and text stream mining tutorial
Text and text stream mining tutorialText and text stream mining tutorial
Text and text stream mining tutorial
 
Fundamentals of DBMS
Fundamentals of DBMSFundamentals of DBMS
Fundamentals of DBMS
 
Planning and Implementing a Digital Library Project
Planning and Implementing a Digital Library ProjectPlanning and Implementing a Digital Library Project
Planning and Implementing a Digital Library Project
 
Slide 3 data abstraction & 3 schema
Slide 3 data abstraction & 3 schemaSlide 3 data abstraction & 3 schema
Slide 3 data abstraction & 3 schema
 
Apriori
AprioriApriori
Apriori
 
Information retrieval introduction
Information retrieval introductionInformation retrieval introduction
Information retrieval introduction
 
Presentation of Data
Presentation of DataPresentation of Data
Presentation of Data
 
Data Abstraction
Data AbstractionData Abstraction
Data Abstraction
 

Similar to Description of data

Similar to Description of data (20)

Dsa unit 1
Dsa unit 1Dsa unit 1
Dsa unit 1
 
DS_PPT.pptx
DS_PPT.pptxDS_PPT.pptx
DS_PPT.pptx
 
Data structures; arrays By ZAK
Data structures; arrays By ZAKData structures; arrays By ZAK
Data structures; arrays By ZAK
 
Lect11
Lect11Lect11
Lect11
 
2. Introduction to Data Structure.pdf
2. Introduction to Data Structure.pdf2. Introduction to Data Structure.pdf
2. Introduction to Data Structure.pdf
 
Unit 1 introduction to data structure
Unit 1   introduction to data structureUnit 1   introduction to data structure
Unit 1 introduction to data structure
 
DS_PPT.ppt
DS_PPT.pptDS_PPT.ppt
DS_PPT.ppt
 
8074.pdf
8074.pdf8074.pdf
8074.pdf
 
Data Types - Premetive and Non Premetive
Data Types - Premetive and Non Premetive Data Types - Premetive and Non Premetive
Data Types - Premetive and Non Premetive
 
Databases By ZAK
Databases By ZAKDatabases By ZAK
Databases By ZAK
 
1- Introduction.pptx.pdf
1- Introduction.pptx.pdf1- Introduction.pptx.pdf
1- Introduction.pptx.pdf
 
Data structure.pptx
Data structure.pptxData structure.pptx
Data structure.pptx
 
unit1Intro_final.pptx
unit1Intro_final.pptxunit1Intro_final.pptx
unit1Intro_final.pptx
 
Ch10
Ch10Ch10
Ch10
 
Cs341
Cs341Cs341
Cs341
 
12 SQL
12 SQL12 SQL
12 SQL
 
12 SQL
12 SQL12 SQL
12 SQL
 
Chapter4.pptx
Chapter4.pptxChapter4.pptx
Chapter4.pptx
 
Chapter 1 - Introduction to Data Structure.ppt
Chapter 1 - Introduction to Data Structure.pptChapter 1 - Introduction to Data Structure.ppt
Chapter 1 - Introduction to Data Structure.ppt
 
Data structures "1" (Lectures 2015-2016)
Data structures "1" (Lectures 2015-2016) Data structures "1" (Lectures 2015-2016)
Data structures "1" (Lectures 2015-2016)
 

Recently uploaded

Call Girls In Mahipalpur O9654467111 Escorts Service
Call Girls In Mahipalpur O9654467111  Escorts ServiceCall Girls In Mahipalpur O9654467111  Escorts Service
Call Girls In Mahipalpur O9654467111 Escorts ServiceSapana Sha
 
B2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docxB2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docxStephen266013
 
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...
Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...
Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...shivangimorya083
 
{Pooja: 9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
{Pooja:  9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...{Pooja:  9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
{Pooja: 9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...Pooja Nehwal
 
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...Sapana Sha
 
04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationshipsccctableauusergroup
 
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...dajasot375
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfMarinCaroMartnezBerg
 
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /WhatsappsBeautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsappssapnasaifi408
 
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...soniya singh
 
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service AmravatiVIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service AmravatiSuhani Kapoor
 
100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptxAnupama Kate
 
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779Best VIP Call Girls Noida Sector 39 Call Me: 8448380779
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779Delhi Call girls
 
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...Jack DiGiovanna
 
Aminabad Call Girl Agent 9548273370 , Call Girls Service Lucknow
Aminabad Call Girl Agent 9548273370 , Call Girls Service LucknowAminabad Call Girl Agent 9548273370 , Call Girls Service Lucknow
Aminabad Call Girl Agent 9548273370 , Call Girls Service Lucknowmakika9823
 
Ukraine War presentation: KNOW THE BASICS
Ukraine War presentation: KNOW THE BASICSUkraine War presentation: KNOW THE BASICS
Ukraine War presentation: KNOW THE BASICSAishani27
 

Recently uploaded (20)

Call Girls In Mahipalpur O9654467111 Escorts Service
Call Girls In Mahipalpur O9654467111  Escorts ServiceCall Girls In Mahipalpur O9654467111  Escorts Service
Call Girls In Mahipalpur O9654467111 Escorts Service
 
B2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docxB2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docx
 
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...
Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...
Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...
 
{Pooja: 9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
{Pooja:  9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...{Pooja:  9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
{Pooja: 9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
 
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
 
04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships
 
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdf
 
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in Kishangarh
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in  KishangarhDelhi 99530 vip 56974 Genuine Escort Service Call Girls in  Kishangarh
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in Kishangarh
 
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /WhatsappsBeautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
 
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
 
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
 
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service AmravatiVIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
 
100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx
 
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779Best VIP Call Girls Noida Sector 39 Call Me: 8448380779
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779
 
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...
 
Aminabad Call Girl Agent 9548273370 , Call Girls Service Lucknow
Aminabad Call Girl Agent 9548273370 , Call Girls Service LucknowAminabad Call Girl Agent 9548273370 , Call Girls Service Lucknow
Aminabad Call Girl Agent 9548273370 , Call Girls Service Lucknow
 
Ukraine War presentation: KNOW THE BASICS
Ukraine War presentation: KNOW THE BASICSUkraine War presentation: KNOW THE BASICS
Ukraine War presentation: KNOW THE BASICS
 

Description of data

  • 1. CHAPTER 3 : DESCRIPTION OF DATA
  • 2. Chapter Objectives At the completion of this chapter, you would have learnt:  the different types of data;  the different types of data structures.
  • 3. Introduction  Data is any collection of numbers, characters or other symbols that has been coded into a format that can be input into a computer and processed.  The main function of a computer program is to process data to produce information. That is, to accept data from the user as input, process the data and present the information to the user as output
  • 4. 3.1 Types of Data There are two fundamental types of data: Numeric and Non-numeric.  Numeric(Qualitative) Numbers used for sums of money, ages, distances. For example 0.33, -0.1, 0.5, 2, 50.01, -100, etc.  Non-Numeric(Quantitative) Non numbers such as strings of characters. For example ‘John’, ‘AS1234G’ and ‘2@**556’, etc.
  • 5. DATA DIAGRAM Data Numeric Non Numeric Char String Logical Pointer DatesInteger Real
  • 6. 3.1.1 Numeric Divided into two main groups: Integer and Real.  Integer  Whole numbers used to count things, example 1, 2, 3,...  Count discrete objects such as number of bananas, orange or pencils.  Precise values.  The range of integers provided in a computer system depends on the hardware/language used.
  • 7.  REAL  May have a fractional part, example 1.0, 234.66, ...  Can be positive or negative.  To measure things like the length of a piece of string, or the cost of an item in dollars and cents.  Generally NOT a precise value.  Nearest value is according to the method of storage and type of arithmetic used (e.g. for rounding off method, 14.385 in this case will become 14.39 and 14.382 will become 14.38 whereas for truncation to two decimal places both 14.385 and 14.382 will become 14.38).
  • 8. 3.1.2 Non-Numeric 1. Character strings Character strings may consist of Numbers, Alphabets or Alphanumeric. To represent such character strings, quotes (’) are needed. For example the name JAMES will need to be quoted as ‘JAMES’.
  • 9. 2. String  String characters are stored as codes using the American Standard Code for Information Interchange (ASCII) or Extended Binary Coded Decimal Interchange Code (EBCDIC) code system.  String operation usually involves comparison, concatenation or selection to allow combinations of strings. Thus strings should have different values also. For example, ‘A’ < ‘Z’, ‘ABC’ > ‘AAA’ ‘Alpha’ < ‘Alphabet’ and lowercase characters > Uppercase characters
  • 10. 3.Logical / Boolean data  Consists of 2 values: True or False. 4.Pointers  which store the address of variables. 5. Dates  which allow arithmetic operation on calendar dates.
  • 11. 3.1.3 Identifiers  All data items used in a program need to be declared before usage. This means to state down the name given to each data item storage cell known as “identifier”. An identifier may be numeric or non- numeric. The data type that can be contained in the storage cell will depend on the declaration of the cell.
  • 12. These storage cells can be a constant storage cell or variable storage cell.  Constants It is a “Read-only” variable which contains fixed data values that cannot be changed during the program execution.  Variables Their content changes according to the users input or the processing of the program during execution.
  • 13. 3.2 Types of Data Structure  Data items grouped logically together to give information about an individual.  For example, an address book is a data structure containing data items (names, addresses, phone numbers etc.). 3.2.1 Arrays and Tables 3.2.2 Structured Diagrams 3.2.3 Static vs. Dynamic Data Structure 3.2.4 Files, Records and Fields
  • 14. 3.2.1 Arrays and Tables  An array is a sequence of consecutive storage locations having a common name.  Refer to the contents of the storage cells of each array element by a “subscript” or “index” which is enclosed with a square bracket, e.g. [1], [5,3] or [counter].  Grouping of variables in an array of several elements.  For example, a one-dimensional array that stored 6 test marks of a student. This array is called ‘StudentFile’.  StudentFile 76 77 78 56 89 90 0 1 2 3 4 5
  • 15.  The value in each of the box stores a test mark.  Refer to the contents of the storage cell of each array element by a “subscript” or “index”. For example, to refer to the test mark in box number 3, what you will need to do is to call the array by its name, followed by the “subscript” or “index” shown below it. In this case, you can refer to the contents of box number 3 by calling “StudentFile[3]”.  A one dimensional array can only hold a student’s test marks in this case, so if a data structure that is supposed to be created to store all the test marks of a class of students, a two dimensional array must be used.  A two dimensional array is a table that can store more information. An example is shown on the next page.
  • 16. A two-dimensional array that stores 6 tests marks of 3 students. StudentFile In this case, you can refer to the content of the third box in the first row by calling “StudentFile[1,3]”. 1 76 77 78 56 89 90 2 76 89 87 47 85 58 3 56 34 78 67 98 76 1 2 3 4 5 6
  • 17. 3.2.2 Structured Diagrams  To show the grouping and relationship of data items in a real case in pictorial form, we can use data structure diagrams. Characteristics of a Structured Diagram  Shows how to sub-divide a data item into its parts using the three data structure constructs. Three Data Structure Constructs Simple elements such as address can be represented with a rectangle box. 1. Sequence Construction 2. Selection Construction 3. Repetition/Iteration Construction Address
  • 18. Three Data Structure Constructs  Simple with lower level - To show its contents more clearly, it is sub-divided into different parts shown at the lower level in the following diagrams. Address Street Name Postal CodeHouse Number (Sequence construct) (Selection construct) CAR SALOON ESTATESPORTS O O O
  • 19. Note: If one element connected upwards is a selection, all elements connected up to the same point must be selections. Only one selection will be made regardless of the number of choices. Example: (Repetition / Iteration construct) Main Process EndIntro *
  • 20. Data Structure on an Address Book FILE RECORD TRAILERHEADER * ADDRESS TELEPHONENAME INITIALSSURNAME UNIT-CODEAREA CODE STREET TOWNHOUSE NAMENUMBER oo
  • 21. 3.2.3 Static vs. Dynamic Data Structure  “STATIC” data structure - the size of the data structure needed to store information CANNOT change as the program runs. E.g. array.  “DYNAMIC” data structure - the size of the data structure needed to store information CAN change as the program runs. E.g. linked list.  Each member of the list essentially forms a record in the list.  Each member record is linked to the NEXT LOGICAL RECORD by means of a special field within the record called a POINTER.  The POINTER field contains the address of the next logical record in the list. Note: Not all languages have linked lists.
  • 22. Types of linked lists are  Binary tree  Ring Start point
  • 23. 3.2.4Files, Records and Fields  File A file is defined as a group of related data records handled as a logical unit. For example, the stock master file contains data records of all stock items in the warehouse, the payroll master file contains data records of all employees currently on the payroll of the organisation.
  • 24.  Record A record is defined as a group of related data items called fields, forming a logical unit. For example, the stock master record may contain data items like ITEM-CODE, DESCRIPTION, UNIT-PRICE, QUANTITY-ON- HAND and so on. These data items make up the stock master record, and they are called FIELDS.
  • 25.  Field A field is a data item forming a subdivision of a record. Record no. 1 Student Number Student Name Date of Birth Sex Exam Mark 1289 Cindy Bridges 080471 F 76 1290 Alan Lim 060970 M 80 Record no. 1 Record no. 2 File Fields
  • 26.  Record key Definition A record key is defined as a field within a record that is used as the basis for ordering the records in a sequential file and also as a means of direct access. Examples STOCK MASTER file arranged in ascending order of item code which is the record key that must be unique. SUPPLIER MASTER field arranged in order of vendor number, which is the record key.