Question: Write a program using C + + to convert from binary, octal, hexadecimal and decimal numbers ( both integers and floating point numbers ) .

Write a program using C++to convert from binary, octal, hexadecimal and decimal numbers (both integers and floating point numbers).Your program woud 1) ask the users to enter a number in binary or decimal 2) ask the users what type of number it is (binary or decimal)3) check to make sure the number is legal (a decimal number contains only 0-9). If the number is not legal, it should error out!4) If the number is legal, convert the number to the other 3 types (Hint: There are a total of 4 types: binary, octal, hexadecimal, decimal).Program needs to do basic error-checking NOTE: You CANNOT use ANY pre-defined built-in functions to do the conversion such as the following!! Integer.toString(n,8)// decimal to octalInteger.toString(n,2)// decimal to binaryInteger.toString(n,16)//decimal to Hex You must use your functions/methods. Think iteration (loops) or recursion. You must use the addition/subtraction method or the division/multiplication method

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 Programming Questions!