Question: 2. Write a command line C++ program that will read from a file a number in any base and convert it to decimal. The program

 2. Write a command line C++ program that will read from

2. Write a command line C++ program that will read from a file a number in any base and convert it to decimal. The program should read the input from an input file and display the result in another output file. The first line of the input file contains a number N that represents the number of numbers to be converted. The file then contains N lines where each line consists of the base of the number followed by the number (which may contain a radix point). The output file contains N lines where each line starts with the number read followed by its decimal equivalent. See the below examples for input and output. Please note that you are not allowed to use any C/C++ binary/bit operators. Sample input 4 16 11.8 5 0.2034 2 10010011 3 10212 Sample output 11.8 base 16 17.5 decimal 0.2034 base 5 = 0.4304 decimal 10010011 base 2 147 decimal 10212 base 3 = 104 decimal

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!