Write a program that: 1) converts an unsigned integer of a specified base to an
ID: 3558888 • Letter: W
Question
Write a program that: 1) converts an unsigned integer of a specified base to an unsigned integer of another specified base ; 2) converts a signed decimal integer to its 32-bit signed magnitude and 32-bit 2's complement hexadecimal representations, and 3) converts a float into its base 2 scientific notation . You may use class(es), if you wish, but they are not required.
Additional Specifications
For parts 1 and 2
1.1. You must read the input numbers into character arrays.
1.2. All conversions must be done explicitly by your program. You may not call atoi, atof, sprintf(), hex, %x, cast, or
any other built-in converting functions.
You may assume that all inputs will be valid. There is no need for error checking.
The only header file you may #include is iostream.
The format of your output must match mine exactly. We use diff to compare your output to mine to determine your
score.
Unsigned integer numbers.
5.1. You may assume that the unsigned integers will fit into a 64-bit unsigned long long.
5.2. The possible bases are 2-16 inclusive. For bases 11 to 16, you should use the letters A-F for digits valued greater
than 9.
5.3. Hint: Use a base 10 representation as an intermediate form for all combination of bases.
Signed integer numbers.
6.1. The input format will be [-][0-9]+, with no leading zeroes.
Float.
7.1. IEEE 32 bits (float): 31 sign bit, 23-30 exponent (with 127 offset), 0-22 mantissa (with implicit leading 1).
7.2. Your mantissa should have the implicit leading 1 prepended.
7.3. Hint: To make use of the bitwise operators you will need to convert your float to an integer. I used