Question: Part - B ) . [ 1 5 % ] Further implement a class MyClassInt as the datatype of variables to store in an MyArray
PartB Further implement a class MyClassInt as the datatype of variables to store in an MyArray
object. The class MyClassint stores an int number and only contains one private value:
val: an int variable storing a number.
MyClassint further contains the following public member functions:
MyClassint :the default constructor to initialize val
MyClassint int :the parameterized constructor to initialize valv
operator:overload the operator that copies the value of another object to the current object.
Use deep copy.
operator: overload the operator : overload the operator compare the object with another object through the value
their member variables val. Return true the current object larger; otherwise return false.
Create object MyArray assigning the template MyClassint with capacity Then print the max
variables storing the object shown the examples.
Note: You need overload the operators MyClassint correctly order call the function getMax
defined MyArray.
Example underlined:
Example underlined:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
