Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Harness The Power Of Big Data The IBM Big Data Platform

Authors: Paul Zikopoulos, David Corrigan James Giles Thomas Deutsch Krishnan Parasuraman Dirk DeRoos Paul Zikopoulos

1st Edition

0071808183, 9780071808187

More Books

Students also viewed these Databases questions