Professional Documents
Culture Documents
Lab Exp 4-Declaring-Arrays
Lab Exp 4-Declaring-Arrays
CCS0023L
(Object Oriented Programming)
EXERCISE
4
Declaring Arrays
Section:
TX21
Professor:
Doc Janice Abellana
I. PROGRAM OUTCOME/S (PO) ADRESSED BY THE LABORATORY EXERCISE
a. Apply knowledge of computing appropriate to the discipline.
Array is a sequence of objects of the same type and packaged together under one identifier name. The
first element in an array is at position zero: array [0]. There are three steps to create an array:
Declaration, Construction and Initialization.
Declaring one-dimensional
data_type name_of_array[integer_expression];
Example:
Example:
Array Controlling
V. EXPERIMENTAL PROCEDURE:
1. Create a program that will store student information in two dimensional array
studentarr[3][3], the program should be able to display the names of the students
and their corresponding grades and averages.
Studentarray[3][3]={{“peter”, 75,77},
{“clark”, 78, 80},
{“logan”,82,84}};
VI. QUESTION AND ANSWER:
1. Why is it necessary, being a programmer, to use arrays?. What are the risks of not using
arrays?
___Array helps to save the memory of the system. It also helps when the pre-defined array has
insufficient memory. At runtime, memory can be allocated manually during run time. One of the
risks of not using array is that it would be very difficult to write anything substantial without
arrays even though data structures can do the same job , it would not be just as efficient as
arrays.________________________________________________________________________
Note: The following rubrics/metrics will be used to grade students’ output in the lab
Exercise 2.
Topic Arrays
Lab Activity No 4
Lab Activity Declaring Arrays
CLO 2
Program execution (20)
Correct output (20)
Design of output (10)
Design of logic (20)
Standards (20)
Delivery (10)
TOTAL