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
![data member: value[200]. The size of this array is fixed. The IntType](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f95a5048ec5_61566f95a4fe1ede.jpg)
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
Get step-by-step solutions from verified subject matter experts
