Page 64 - Computer Genius Class 07
P. 64
Step 3 Modify the ‘on start’ block as shown below.
Well done, you have learnt to implement return function.
Information Literacy
Quest Media Literacy
Answer the following questions:
1. What is the main purpose of using functions?
2. What does function returns when an operation is performed inside
a function?
An array is an arrangement of objects. Have you seen an egg box? In an egg box, the eggs are
arranged in a rectangular fashion. This is an array.
What are Arrays?
An array is a collection o similar data type aria les. Arrays do not support different data types. For
example, you can make an array of Integers and another array of Strings, but cannot make an Array
having Integer and Strings in the same Collection.
Books in a library, is an example of arrays where all the shelves have a common data type
(read – book) in it.
Advantage of the array is that it improves the readability of code by using a single variable for a
large set of data. But there are limitations of array also, which are:
You can only store variables with the same data types in an array
The variables in an Array are always ordered sequentially with the index starting from 0.
Arrays are al ays static and fi ed in length and si e.
Array Declaration
Declaration of array with variables of integer data type is:
arr=[10, 20, 30, 40, 50, 60];
10 20 30 40 50 60
0 1 2 3 4 5 Array Indices
Array Length=6, First index=0, Last index=5
62 Computer Genius-VII

