Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 5

COE0027L

(Computer Programming)

SUMMATIVE

4
DECLARING ARRAYS

De Vera, Airell Francis S. Mr. Jonathan Fuller


Date Performed: Oct 7, Date Submitted: Oct 7,
2022 2022
I. OBJECTIVES:

At the end of the experiment, students must be able to:


Cognitive
a) understand how single and multi-dimensional array executes
b) understand the logic of arrays declaration and accession.
c) understand how arrays are manipulated and used
.
Psychomotor:
a) construct a program using arrays
b) compile and debug the error of the program

Affective
a) appreciate the concept behind this experiment

II. BACKGROUND INFORMATION

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:

Referencing an element in a one-dimensional array

The syntax is:


<array name> [<index>]
Array Assignment

Example:

Array Controlling

III.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}};
IV. QUESTION AND ANSWER:

1. Why is it necessary, being a programmer, to use arrays? What are the risks of not using
arrays?
 The fact that arrays model how a computer works with memory and bytes written to
and from disks is one of the main reasons they are popular as a storage and retrieval
mechanism in applications. As a result, they are the simplest to generate internally
using efficient hardware-facing code. When it comes to reading and writing data,
arrays have two significant advantages:

Sequential access that is extremely rapid

Extremely fast random access

2. When do usually single dimensional array is used?


 All types of lists are represented by one-dimensional arrays. These are also used to
create data structures like stacks, queues, heaps, and so on. One Dimensional Array
Limitations: Prior knowledge of the number of elements is required.

V. ASSESSMENT

Department Computer Science Department


Subject Code COE0027L
Description Computer Programming
Term/Academic Year 1 / 2020-2021

Topic Arrays
Lab Summative 4
No.
Lab Summative Declaring Arrays
CLO 2

Note: The following rubrics/metrics will be used to grade students’ output in the Lab
Summative 4.

Criteria Score
Program execution (20)
Correct output (20)
Design of output (10)
Design of logic (20)
Standards (20)
Delivery (10)
TOTAL

You might also like