You are on page 1of 1

T322: ICT102 Introduction to Programming

Tutorial 6
Topic: Arrays

Submission: All files must be uploaded on Moodle by end of the week.

Description: This tutorial will introduce you to Arrays and possible operations

Exercise 1: Array sorting


Define an array of integer type and initialize it with 10 integer numbers.
Display the array to the screen
Use Array class Sort method to sort the same array and display to the screen

Hint: import java.util.Arrays;

Exercise 2: Parallel Arrays

Define two arrays that can be used in parallel to store the Product Name and Product
Price.

Ask the user how many products need to be saved and define a loop to enter the info
in both arrays.

Write a loop that uses these arrays to print each of the Product Name and its price

Submission Task – Grade 1%


Create a program that asks users to enter sales for 7 days. The program should calculate and
display the following data:

• The average sales


• The highest amount of sales.

ICT102: Tutorial 6

You might also like