Tuesday, 11 March 2014

Tutorial 1 - Question 3

Create a class that is generic that has an 1 array with size of 20 in it and 1 porition variabable  .
create a generic add method that add any elements specified for the array to the last available item in the array . if the array is currently full , you have to remove the first element and push the remaining element up and add the new element at the last position.

Create a remove method that remove the last item by nullified/vacant that particular array position.

Create a print method that print all the element


Tutorial 1 - Question 2

Creata a generic method  that ill be used in class that will print any Array elements that it  been supplied with regardless the type .

Tutorial 1 - Question 1

Question 1

Write a generic method to find the maximal element in the range [startrange,endrange] of a list/ where the startrange is the starting position of the list ,[endrange] is the end position within the list.