Question: Question 5 (10 marks) Consider a class IntType with an array data member: value[200]. The size of this array is fixed. The IntType class has

 Question 5 (10 marks) Consider a class IntType with an array
data member: value[200]. The size of this array is fixed. The IntType

Question 5 (10 marks) Consider a class IntType with an array data member: value[200]. The size of this array is fixed. The IntType class has 7 member functions as follows: . IntType(): A default constructor that sets the each element of value array to zero. IntType(int x[]): A parameterized constructor that has one input parameter, a integer array. The content of this x[] should be copied to value array. Assume the length of the x array is also 200. Operator=(IntType &y): An overloaded operator = for this IntType class. IntType(const IntType &x): A copy constructor that has one input parameter of type IntType. bool operator ==(IntType &y); // if any array element is different, return // false; otherwise, return true. IntType& operator ++0: pre-fix ++, which increments each array element by 1 before the assignment operation. IntType operator ++(int): post-fix ++, which increments each array element by 1 after the assignment operation. Class IntType { public: IntType(); IntType(int x[]); operator-(IntType &y); IntType(const IntType &x); bool operator ==(IntType &y); IntType& operator ++0; // pre-fix ++ IntType operator ++(int); // post-fix ++ private: int value[200]; } Write the implementation (i.e., the detailed definition) of all six member functions (7 marks) Draw a UML class diagram for this class

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!