I am trying to write a C++ program that will convert any base 10 number v to any base b. It reads in two values at a time, from a file, the first is the base 10 number and the second value is the base that the base 10 number v is to be converted to, and then it prints the results to an output file. The base can only be between 2 and 9, and any invalid input should be flagged as invalid.
I am trying to write the code as a function to be called in from the main function, so there is little code in the main.
Attached Word file (named as "Base Conversion File.dat") gives the data to be used as input.© BrainMass Inc. brainmass.com March 21, 2019, 9:20 pm ad1c9bdddf
Please find attached an implementation 371335.cpp that has been tested for warning free compilation, using "g++ -Wall 371335.cpp", and correct working, using ...
Program makes use of macros INPUT_FILE_NAME and OUTPUT_FILE_NAME to refer to input and output files respectively.