Array
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.
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.