0% found this document useful (0 votes)
74 views6 pages

Tsa1 Macasaet

This document provides instructions for a laboratory exercise on declaring arrays in Java. The exercise addresses applying computing fundamentals and developing programs that can automate real-life tasks. Students are asked to create a program that stores student information like names and grades in a two-dimensional array and displays the output. Metrics for grading the program are provided, focusing on correct execution, output, logic, code quality, and timely delivery.

Uploaded by

Kevin Macasaet
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
74 views6 pages

Tsa1 Macasaet

This document provides instructions for a laboratory exercise on declaring arrays in Java. The exercise addresses applying computing fundamentals and developing programs that can automate real-life tasks. Students are asked to create a program that stores student information like names and grades in a two-dimensional array and displays the output. Metrics for grading the program are provided, focusing on correct execution, output, logic, code quality, and timely delivery.

Uploaded by

Kevin Macasaet
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 6

COLLEGE OF COMPUTER STUDEIS

INFORMATION TECHNOLOGY DEPARTMENT

CCS0023L
(Object Oriented Programming)

EXERCISE

4
Declaring Arrays

Student Name / Group


Name:
Name Role
Members (if Group):

Section:

Professor:
I. PROGRAM OUTCOME/S (PO) ADRESSED BY THE LABORATORY EXERCISE
a. Apply knowledge of computing appropriate to the discipline.

II. COURSE LEARNING OUTCOME/S (CLO) ADDDRESSED BY LABORATORY


EXERCISE
2 Apply knowledge of computing fundamentals and develop computer programs as a result of
evaluating possible alternative program constructs that will address the need for automating
real life tasks, taking into account the efficiency and effects of their choice of constraints.

III. INTENDED LEARNING OUTOME/S (ILO) ADDRESSES BY THE LABORATORY


EXERCISE
 Create Java programs using the Java Operators
 Create Java programs using the different flow control structures
 Create Java programs using single and multi-dimensional arrays

IV. 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

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}};
public class Main
{
public static void main(String[] args) {

String Studentarray[][] =
{{"Peter", "75", "77"},
{"Clark", "78", "80"},
{"Logan","82","84"}};
System.out.println("Student Array: \n");
for(int i=0; i<3; i++){
for(int j=0; j<3; j++){
System.out.print(Studentarray[i][j] + " ");
}
System.out.println(" ");
}
}
}

VI. QUESTION AND ANSWER:

1. Why is it necessary, being a programmer, to use arrays?. What are the risks of not using
arrays?

it is necessary and most convenient type of control structure to use is the IF-ELSE structure.
Mainly because, if-else involves just little amount of declaration and variables needed to run
your program. It is more convenient because it gives you the proper options in what you are
trying to execute so that you will not miss a single thing that you need

2. When do usually single dimensional array is used?

the easiest strategy in doing loop statements is the do while. Mainly because it is easier to code
rather than other looping statements. Do while statements tend to help you to really understand
how your program will run properly and effectively, that`s why like to use this statement often.

Note: The following rubrics/metrics will be used to grade students’ output in the lab
Exercise 2.

Program (100 pts.) (Excellent) (Good) (Fair) (Poor)


Program Program executes Program executes Program executes Program does not
execution (20pts) correctly with no with less than 3 with more than 3 execute (10-11pts)
syntax or runtime errors (15-17pts) errors (12-14pts)
errors (18-20pts)
Correct output Program displays Output has minor Output has Output is incorrect
(20pts) correct output errors (15-17pts) multiple errors (10-11pts)
with no errors (12-14pts)
(18-20pts)
Design of output Program displays Program displays Program does not Output is poorly
(10pts) more than minimally display the designed (5pts)
expected (10pts) expected output required output (6-
(8-9pts) 7pts)
Design of logic Program is Program has slight Program has Program is
(20pts) logically well logic errors that do significant logic incorrect (10-
designed (18- no significantly errors (3-5pts) 11pts)
20pts) affect the results
(15-17pts)
Standards Program code is Few inappropriate Several Program is poorly
(20pts) stylistically well design choices inappropriate written (10-11pts)
designed (18- (i.e. poor variable design choices
20pts) names, improper (i.e. poor variable
indentation) (15- names, improper
17pts) indentation) (12-
14pts)
Delivery The program was The program was The program was The program was
(10pts) delivered on time. delivered a day delivered two days delivered more
(10pts) after the deadline. after the deadline. than two days after
(8-9pts) (6-7pts) the deadline. (5pts)

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

You might also like