Question: Given big_num.h and big_num_driver.cpp implement, the big_num class so that the main in big_num_driver.cpp will work. Do not change the main it is good. //big_num_driver.cpp

Given big_num.h and big_num_driver.cpp implement, the big_num class so that the main in big_num_driver.cpp will work. Do not change the main it is good.

//big_num_driver.cpp

#include #include #include #include "big_num.h"

int main() { std::string str; std::cout << "Enter a number: "; getline(std::cin,str); big_num x(str); std::cout << "Enter a number: "; getline(std::cin,str); big_num y(str); big_num result = (x+y); std::cout << x <<" + " << y << " = " << result; std::cout << std::endl; return 0; }

/// big_num

#ifndef BIGNUM_H #define BIGNUM_H #include #include #include #include

class big_num { public: big_num(std::string); friend std::ostream& operator << (std::ostream& out, big_num&); friend big_num operator +( big_num&, big_num&); int& operator [](int i) {return digits[i];} int size() const {return digits.size();} private: std::vector digits; // an array of numDigits digits };

#endif

// implement USING C++ so that it works.

big_num(std::string);

friend std::ostream& operator << (std::ostream& out, big_num&);

friend big_num operator +( big_num&, big_num&);

The classes that we have to code.

Exmaple:-

Enter a number : 98347901287

Enter a number : 38120383

98347901287 + 38120383 = 98386021670

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!