Question: Write a C++ program to perform number base conversion, specifically with Base 2 and Base 10. 1) It should include the following functional requirements: Receive
Write a C++ program to perform number base conversion, specifically with Base 2 and Base 10.
1) It should include the following functional requirements:
Receive user input in Base 10
Receive user input in Base 2 (receive only 1s and 0s)
Output the user input in Base 10 along with the conversion to Base 2
Output the user input in Base 2 along with the conversion to Base 10
Continue this process while the user input in Base 10 is non-negative
2) Implement the following 3 functions:
Base 10 to Base 2
Base 2 to Base 10
Input of Base 2 value to enforce the entry of only 1s and 0s
Below is an example of Base 2 to Base 10 conversion:

Below is an example of Base 10 to Base 2 conversion:

11001 -1 x 29 = 1x1 = 1 - 0x2 = 0x2 = 0 - 0x2 = 0x4 = 0 - 1x2 = 1x8 = 8 - 1 x 24 = 1x16 = 16 1+0+0+ 8 + 16 = 25 (Base 10) Decimal to Binary 247 2 23 2 11 (47), = (101111)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
