You are on page 1of 1

CSC508 Data Structure 2022-2023

Lab Exercise 2

Array

1. Write a program to create and initialize the following array billy, then find the average value
in the array.

int[] billy = {16, 2, 77, 40, 12071, 51};

2. There are 15 students in a class. Write a program to accept the students’ name and exam
marks. The information is to be stored in arrays. The create the method bestStudent() to
find and display the name of the best student. You need to determine which arguments to be
passed to the bestStudent() method.

3. Palindrome is a string or number that remains the same when its digits are reversed. For
example, 234585432. Using ArrayList class;
a. Create an array object for 10 integer.
b. Input and store a sequence of integer into the array.
c. Determine whether the integer sequence is an integer or not.

1
Universiti Teknologi MARA

You might also like