Q)
(chatquestion)...7. Aclass collection contains an array of 100 integers. Using the following class descriptions create an array with some common
elements from two integers arrays.
Some of the members of the class are given below:
Class name
Collection
Data members
arr[]
len
integer array
length of the array
Members Function
Collection()
Collection(int)
Void inparr()
Collection common(Collection)
default constructor
Parameterized constructor to assign the length of the array.
to accept the array elements.
returns a Collection containing the common elements of current Collection object
and the collection object passed as a parameter.
Void arrange()
sort the array elements of the object containing common elements in ascending
order using any sorting technique.
Void display()
display the array elements.
Specify the class collection giving the details of the constructor Collection(), void inparr(), Collection common(collection) and
void arrange(). You need not write the main function.
2 Answers
...