Question: Write the program in python. Assume that the input numbers are strings instead of integers. THE PROBLEM You have to write two functions to transform
THE PROBLEM You have to write two functions to transform a number from binary to decimal and from decimal to binary. For both functions, your parameter will be an integer value prompted by the user. For the binary to decimal case, you must write an additional function to validate that the integer value prompted by the user has only zeros and ones. Finally, you will use the previous functions to write a program that: a) allows the user to select the base of the input number; b) prompts the user for the input number (for the binary case, you must validate that the number has only zeros and ones); and c) prints the value in its new base. Your program will execute these steps until the selected base of the input number prompted by the user is equal to zero (exit). The output of your program should look like: Enter the base of the input value (2 Enter the number in base 2: 10101 Bin/Dec, 10 Dec/Bin, Exit): 2 The number 10101 is equal to 21 in base 10 Enter the base of the input value (2 -Bin/Dec, 10 Dec/Bin, Exit): e
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
