Question: #ifndef BIGUINT_H #define BIGUINT_H #include using namespace std; class BigUInt { private: unsigned char* data; int length; public: BigUInt(); // Initialize to zero objects //

#ifndef BIGUINT_H #define BIGUINT_H

#include using namespace std; class BigUInt {

private: unsigned char* data; int length;

public: BigUInt(); // Initialize to zero objects // 2. (5 points) Initializes the BigUInt to n. // Allocate data to an array the number of digits. BigUInt(unsigned int n); // 3. (1 point) Frees space in data. ~BigUInt(); // 4. (1 point) Print the number represented by this BigUInt. void Print(); // 5. (4 points) Set this BigUInt to original value times 10^p. // Allocate space as neccessary. void TimesTenPow(unsigned int p); // 6. (6 points) Set this BigUInt to original value plus rhs. // Allocate space as necessary. BigUInt& operator+=(const BigUInt& rhs); // 7. (2 points) Print the number represented by this BigUInt. friend ostream& operator<<(ostream& os, const BigUInt& b);

}; ostream& operator<<(ostream& os, const BigUInt& b);

#endif // BIGUINT_H

#include #include "BigUInt.h" using namespace std;

int main() { BigUInt b1(88408721); BigUInt b2(69606478);

b1.Print(); b2.Print();

b1 += b2; b1.Print();

b1.TimesTenPow(15); b1.Print();

/*b1 += b2; b1.Print();

cout << b1; */ return 0; } /* Results: 88408721 158015199 158015199000000000000000 158015199000000069606478 158015199000000069606478 */

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