Question
C++ Please Show output screen please Modify your program to prompt the use for a file name, then read BigIntegers from that file and keep
C++ Please
Show output screen please
Modify your program to prompt the use for a file name, then read BigIntegers from that file and keep a running total.
Program that need to be modified:
#include
using namespace std;
int valueOf(char c) { if ((c >= '0') && (c <= '9')) { return c - '0'; } else { return c - 'a' + 10; } }
std::vector
void displayDecimalDigits(vector
std::vector
std::vector
std::vector
std::vector
if (v1.size() > v2.size()) { int diff = v1.size() - v2.size(); v2 = addLeadingZeros(v2, diff); } else { int diff = v2.size() - v1.size(); v1 = addLeadingZeros(v1, diff); } vector
string s1 = "001238042"; std::vector
b1 = trimLeadingZeros(b1); displayDecimalDigits(b1);
b1 = addLeadingZeros(b1, 4); displayDecimalDigits(b1);
b1 = normalize(b1, 10); displayDecimalDigits(b1);
cout << "Welcome to BigInteger Version 1! "; cout << "Please Enter a Big Integer: "; cin >> s1; std::vector
File:
245665467856549678546678 2545466554675487 34245654686546708 25465464 24546354654685675465465469546789546678901046754345464054 425465467565466785409 1233789132678978780 13223978132576976 10567007484507483087000 34056706789078798054
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started