Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

#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

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_2

Step: 3

blur-text-image_3

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

Data Infrastructure For Medical Research In Databases

Authors: Thomas Heinis ,Anastasia Ailamaki

1st Edition

1680833480, 978-1680833485

More Books

Students also viewed these Databases questions

Question

What is SCM software?

Answered: 1 week ago

Question

a relationship can involve one or many entity sets.

Answered: 1 week ago