Wisdom World School 8. If an array has last index n, then total no.
of elements in an array is
CODING __________________.
Brainstorming of Chapter 4 C. Match the following operators with their use.
Grade 8 Date: a) Index 1)
Topics: Programming with Array
b) Array 2)
A. Multiple Choice Questions:
1.In Programming, a _refers to a memory space that can c) To remove element 3)
hold multiple data items of similar or different data types. from array
a) Pattern b) Sequence c) Program d) Collection d) Creation of array 4) Elements of same data type
2.An can be defined as an ordered collection of items
having similar data types. e) Total elements 5) Starts from 0
a) Function b) Sequence c) Arrays d) Parameter array
3.In the given code, the value of Color[2]:
Color = [“red”, “green”, “yellow”, “blue”] D. Write T for True and F for False:
a) Red b) Green c) Yellow d) Blue a) In make code arcade, the integer values are stored in
4. You can find the array block under the _ block type.
a) Sprites b) Variable c) Advanced d) Math
5.To use or modify the data stored in the array list, you need toaccess its b) Pop() method is used to remove the first element of an array.
a) Elements b) Name c) Index d) Sequence number c) Index( ) method is used to find any element in an array.
d) Bubble sort swap adjacent element to sort the given array.
6. If an array A[20] exists such as it is consisting integers from 11 to 30,
then the element at index 15 is- e) Arrays are sometimes static and fixed in length and size.
a) 34 b) 35 c) 15 d) 25
E. Answer the following questions:
B. Fill in the blanks. a) Define Array. How arrays are indexed in programming?
1. All the values in an array should be of the data type. b) What limitation we must follow while using array?
2. Array elements always stored ____________________ in memory. c) Define the following methods used in an array:
(i) sort ( ) (ii) index( ) (iii) pop( ) (iv) remove( ) (v) append( )
3. The index value in an array starts from .
d) Explain how can you sort array {67,23,98,19} using Bubble sort?
4. Arrays are always _____________ in nature. e) Write the output of the following:
5. Number of elements in array is specified by _______ of an array. name=[“A”, “B”, “E”, “H”, “I”, “B”,“Z”, “R”, “M”, “L”, “T”]
6. ______________ method is used to add element in an array. (i) for i in range(len(name)): (ii) for i in name:
7. ____________method is used to arrange elements in ascending/ print(i) print(i)
descending order. (iii) print(name.append(“C”)) (iv) print(name.index(“R”))
(v) print(name.sort()) (vi) print(name.index(“D”)) (iii)
(vii) print(name.pop(1)) (viii) print(name.remove(“B”))
(ix) print(name.pop()) (x)print(name.append(“Z”,”C”))
f) How many iterations we require to sort the list- [11,9,77,18,22] using
bubble sort?
g) How can be modified elements of an array? (iv)
F. Write the block Code/Pseudo code for the following:
a) Create a name list of 6 student of your class and print:
i) Length of an array
ii) Initial and final Index (v)
iii) Remove the value at initial and final index
iv) insert the name “Sam” at location 3
b) There is a robot which can read the numbers written on the cards only
when kept close to its eyes. It can pick only one card containing
numbers in its left hand and another in its right hand. Can you help it to
arrange the cards in ascending order using bubble sort? Let’s try it on
the numbers 1, 5, 4, 3, 2.
c) Write the output. Also if there is any error, correct it-
Let we have an array-
Marks= [11, 23, 34, 22, 55, 77, 66, 10]
(i)
(ii)