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

Array

Arrays allow a set of identical data types to be stored together using the same name. Arrays have a name, type, and size. There are one-dimensional and two-dimensional arrays. One-dimensional arrays are declared with lower and upper bounds for a single index, while two-dimensional arrays have lower and upper bounds for two indices. Data stored in an array is called an element, and the location of an element is its index. A series of exercises are provided to demonstrate inputting and outputting data from arrays using pseudocode.

Uploaded by

Arham Tamim
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
58 views

Array

Arrays allow a set of identical data types to be stored together using the same name. Arrays have a name, type, and size. There are one-dimensional and two-dimensional arrays. One-dimensional arrays are declared with lower and upper bounds for a single index, while two-dimensional arrays have lower and upper bounds for two indices. Data stored in an array is called an element, and the location of an element is its index. A series of exercises are provided to demonstrate inputting and outputting data from arrays using pseudocode.

Uploaded by

Arham Tamim
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Topic: Array

Array
•Array is data structure, which allows a set of items of
identical data type to be stored together using the same
identifier name.

•It must have name, type and size. It simplifies the program and
reduces the no of variables in the program.

•Arrays are considered to be fixed-length structures of elements


of identical data type, accessible by consecutive index
(subscript) numbers.
Types and declaration of Array
There are two types of array.
•One dimensional Array
•Two dimensional Array
One- and two-dimensional arrays are declared as follows (where l, l1, l2 are
lower bounds and u, u1, u2 are upper bounds):
One dimensional Array

Element: Index:
Data stored in an array is Location of an elements
known as element. in an array is known as
index.
Assigning a group of array elements
Exercise
Exercise 1: Write a pseudocode to input and store names and marks for 30
students and output the average, highest and lowest marks with their
respective names.
Marks are taken out of 50. Apply suitable validation checks where applicable
and invalid marks should be rejected.Use appropriate prompts / suitable
message for input and output.
Exercise 2:(a) Write an algorithm, using pseudocode and a FOR … TO … NEXT
loop structure, to input 1000 numbers into an array.
(b) Rewrite your algorithm using another loop structure.
Exercise 3:Write an algorithm in pseudocode, using a single loop, to print 50
names that have been stored in an array.
Exercise 4: Write an algorithm in pseudocode to input and store50 number in
an array andoutput their sum.
Exercise 5: Write an algorithm in pseudocode to input and store 50 number in
an array and output their multiplication.
Exercise 6: Write an algorithm in pseudocode to input and store 50 number in
an array and output the largest number.
Exercise 7: Write an algorithm in pseudocode to input and store 50 number in
an array and output the smallest number.

You might also like