Sei sulla pagina 1di 1

Institute of Engineering and Technology

Ahmedabad University
Semester II
Section A & B
Lab Assignment Session 4

Assignment Date: Thursday, February 12, 2015 Submission Date: Monday, February 16, 2015

Q1. Design a class called Item in Java to store various attributes of an item. Demonstrate the use
of static members in the Item class for counting the number of objects created in the program.

Q2. Create a class called List in Java having data members capable of storing numbers in a dynamic
array as well as the size of the array. Create appropriate constructor(s) for the class. Create
appropriate member functions for performing the following operations on the list:
(a) Add an item in the list
(b) Delete an item from the list
(c) Check whether the list contains duplicate elements (show with frequency)
(d) Remove duplicate values of elements from the list
(e) Sort the list in ascending order
(f) Sort the list in descending order
(g) Reverse the list
(h) Calculate maximum, minimum, sum, mean, median, mode, and standard deviation

*****

1|Page

Potrebbero piacerti anche