Question: This assignment focuses on converting numbers between bases, specifically base - 2 ( binary ) , base - 1 0 ( decimal ) , and

This assignment focuses on converting numbers between bases, specifically base-2(binary), base-10(decimal), and base-16(Hexadecimal). For the purposes of this assignment, binary and hexadecimal numbers will be represented by a string type, and decimal will be represented by an integer type. The objective of this assignment is to design 6 functions that will perform a number conversion from a source number system to a target number system. All of the input processing has been done for you. Assume that in testing, all of the inputs are received in the correct type. Assume that all possible input numbers are nonnegative. You MAY NOT use any external functions to perform the conversions; you must do the conversions mechanically i.e algorithmically, "the long way". You MAY NOT use any other libraries besides the ones I have provided to you. Any circumvention of these guidelines will result in deductions from your score.
The 6 functions are as follows:
int binary2decimal(string bitstring):
Convert a binary bitstring to a decimal integer.
string decimal2binary(int n):
Convert a decimal integer to a binary bitstring.
int hexadecimal2decimal(string hexstring):
Convert a hexadecimal hexstring to a decimal integer.
string decimal2hexadecimal(int n):
Convert a decimal integer to a hexadecimal hextring.
string hexadecimal2binary(string hexstring):
Convert a hexadecimal hexstring to a binary bitstring.
string binary2hexadecimal(string bitstring):
Convert a binary bitstring to a hexadecimal hexstring.
To test a function, you must first input an input in the menu for the function you would like to test, and then provide the input to the selected function.
Please write a program in C++

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