0

dear all plz i want help in this program can anyone do it......

Question:
Derive a class from long_int class and add a member function "multiply" in the derived class to multiply two long_ints using the add member function already defined.

multiply should work like this 2*3 = 2+2+2 (adding 2, 3 times).

One you are done defining the multiply function, overload * operator to multiply two long_ints.

2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by nustian
0

dear all plz i want help in this program can anyone do it......

Question:
Derive a class from long_int class and add a member function "multiply" in the derived class to multiply two long_ints using the add member function already defined.

multiply should work like this 2*3 = 2+2+2 (adding 2, 3 times).

One you are done defining the multiply function, overload * operator to multiply two long_ints.

This should be a good n easy assignment.
>> Derive a class from long_int class
Create a base class with appropriate data & function members (constructors & destructor etc)
Create a Derived class and define multiply() in it. Pass necessary objects (by reference) to it, return the result.

>> One you are done defining the multiply function, overload * operator
write operator *(reference to object) function, should be very similar to multiply().

I'd suggest you to Try it out yourself.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.