The content is just an excerpt from the complete note for SS3 Second Term Computer Studies Lesson Note – BASIC Programming III (One-dimensional array). Check below to download the complete DOCUMENT

WEEK 3                                                        

TOPIC:          BASIC Programming III (One-dimensional array)

CONTENTS

  • Defining one-dimensional array
  • Operations on Array
  • Review of the (i) FOR-NEXT Statement, WHILE_END Statement etc

Sub-topic 1

What is an Array?

An array is a group of data items given the same name for processing. Students’ scores in some subjects, when listed or arranged under a name, constitute an array.  OR

An array is a series of elements of the same type placed in contiguous memory locations that can be individually referenced by adding an index to a unique identifier. Also arrangement of items of computerized data in tabular form for easy reference and identification is regarded as an array.

Defining one-dimensional array

An array whose values or items are arranged in only one direction is referred to as one-dimensional array. It is also called a linear list. E.g.  [2, 4, 3, 6, 7, 10, 12], [Ade, Ngozi, Zainab, Bello]

Numeric array: contain a set of numbers. The set is given a single name and each number in the array is called an element of the array.

Dimension Statement (DIM): this specifies the maximum values for any variable subscripted, and allocates storage accordingly.  The default is 10.  OR specifies the name of any array as well as the number of elements in the array. E.g.

10 DIM T(40)                                                 Array T has a maximum of 40 elements

15 DIM XI(23), X2(34)                                              Array X1 has a maximum of 23 elements and array X2

SEE ALSO  Primary Five Second Term Agricultural Science Lesson Note

Has a maximum of 34 elements

30 DIM SCORE (400)                                                Array SCORE has a maximum of 400 elements

Suppose we have 400 scores listed for 400 students in a test. The set of scores make up an array. Each score is an element of the array.

To gain full access to the note: DOWNLOAD FILE

Copyright warnings! Do not copy.