Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

TECH 326: PROGRAMMING

LEARNING CHECK

1. What is an array?
An array is a data structure, which can store a fixed-size collection of elements of the
same data type. An array is used to store a collection of data, but it is often more useful
to think of an array as a collection of variables of the same type. An array is a variable
that can store multiple values. For example, if you want to store 100 integers, you can
create an array for it. int data[100];

2. What benefits in using array?


In arrays, the elements can be accessed randomly by using the index
number. Arrays allocate memory in contiguous memory locations for all its
elements. Hence there is no chance of extra memory being allocated in
case of arrays. This avoids memory overflow or shortage of memory in
arrays.

KNOWLEDGE-BUILDING
ASSESMENT TASK 1: QUIZ

1. What is an Array? Give an analogy that we can see in real life that applies the concept of array.
(10pts)
Arrays are the simplest data structures that store items of the same data type. A basic application of
Arrays can be storing data in tabular format. For example, if we wish to store the contacts on our phone,
then the software will simply place all our contacts in an array. An array is a collection of elements of the
same type placed in contiguous memory locations that can be individually referenced by using an index
to a unique identifier. Five values of type int can be declared as an array without having to declare five
different variables (each with its own identifier). The array stores the elements in a contiguous block of
memory of similar types. Therefore, we can say that array is a container that stores elements of similar
types.

2. How can we create an array in C and how can we iterate the data
stored in an array? (10pts)
When we declare an array, space is reserved in the memory of the computer for the array. The elements
of the array are stored in these memory locations. The important thing about arrays is that array
elements are always stored in consecutive memory locations. An array is a collection, mainly of similar
data types, stored into a common variable. The collection forms a data structure where objects are
stored linearly, one after another in memory. Sometimes arrays are even replicated into the memory
hardware. An array is a collection, mainly of similar data types, stored into a common variable. The
collection forms a data structure where objects are stored linearly, one after another in memory.
Sometimes arrays are even replicated into the memory hardware.

CRITICAL THINKING
ASSESMENT TASK 2: FLOW CHARTING AN EXISTING C PROGRAM

You might also like