Question: 2) For this exercise you will write a program to convert numbers to different bases. For example: Your program will prompt the user to enter
2) For this exercise you will write a program to convert numbers to different bases. For example: Your program will prompt the user to enter a "number" and the base of the number. You will then ask what base to convert the number to. Your program will handle all bases 2-36. Your program should include the following features: If the user enters a base outside the range stated above, display an error message and make them re-enter the base. If the number doesn't match the base they typed in, display an error message and have them re-enter all of the information again. (i.e. The character A is invalid for a base 10 number.) . The number displayed to the user should be displayed in uppercase. . Be sure your output is self-documenting. For example: FF (base 16) 255 (base 10)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
