0% found this document useful (0 votes)
26 views

Pascal Programming: Complex Array Structures

The document discusses complex data structures in Pascal programming, including parallel arrays, arrays with a single index, and multidimensional arrays. It provides examples of using dual arrays with a single index to solve problems, how data types and structures are related, and how arrays can have other array types as components. Multidimensional arrays are introduced as arrays with more than one index that can be used to reference elements like cells in a spreadsheet.

Uploaded by

cayerica
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views

Pascal Programming: Complex Array Structures

The document discusses complex data structures in Pascal programming, including parallel arrays, arrays with a single index, and multidimensional arrays. It provides examples of using dual arrays with a single index to solve problems, how data types and structures are related, and how arrays can have other array types as components. Multidimensional arrays are introduced as arrays with more than one index that can be used to reference elements like cells in a spreadsheet.

Uploaded by

cayerica
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 9

Pascal

Programming

Complex Array Structures


Pascal Programming

 Complex solutions, using Pascal or any


other language, need to be reduced
from the abstract to more concrete
statements.
 The example in the text of parallel
arrays to award a score and letter grade
illustrates the validity of the observation.
Pascal Programming

Score Index 1
Grade

Score Index 2 Grade

Score Grade

Score Grade
Pascal Programming

 The solution to the problem arises from


dual arrays with a single index.
 Thus, data type notation and data
structure become tightly related.
 Data structure– any construct to store
and manipulate data in a program or
algorithm.
Pascal Programming

 In this solution, each array type is a


data type.
 The data structure combines the two
arrays.
 With these examples we know that
available structures can include arrays
of arrays and parallel arrays.
Pascal Programming

 Complex solutions require complex data


structures.
 An array’s component type can be
comprised of any data type . . .so, it can
be an array type. Thus we have an
array or array types.
 Consider a spreadsheet example . . .
Pascal Programming
1A 1B 1C

2A 2B 2C

3A 3B 3C
Pascal Programming

 If we substitute Sales for 1-3 and


Territory for A-C, we reference 2C as …
– Sales [2] Territory
 Within the territory we have a monthly
array of sales.
 This illustrates the use of an array of
array type.
Pascal Programming

 An array with more than one index is


called a multidimensional array.
 The declaration follows the form use to
declare a simple or one dimensional
array.
 Multidimensional arrays have more than
one index but they have similar other
properties.

You might also like