Question: In C + + ; Need Help with this weeks lab. I need to Implement a bare bones version of the BigNumber class with just

In C++ ; Need Help with this weeks lab. I need to Implement a "bare bones" version of the BigNumber class with just the following:
string constructor
stream insertion operator
stream extraction operator
// cin >> b;// same as operator>>(cin, b);
istream & operator>>(istream & in, BigNumber & b){
// read the user input (really just a string)
// set b to the BigNumber object corresponding to user input
//(Use the string constructor)
return in;
}
< and== operators(operator< and operator==)
increment and decrement operators(example with decrement4500-->4499
(for completeness provide both pre and post version)
(Special case:100-->099 so update numDigits)
operator+ that uses repeated increment and decrement.
That means b + c -->(++b +--c) Repeat in a loop until c is equal BigNumber(0)
Example12+3-->13+2-->14+1-->15+0--> return 15
Upload BigNumber.h, BigNumber.cpp and a simple driver to test the above member functions.
Driver will just look something like this...
#include
#include "BigNumber.h"
int main()
{
BigNumber b("567");
std::cout << b << std::endl;
b++;
std::cout << b << std::endl;
// more tests
return 0;
}

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 Programming Questions!