Question: Create a C++ program that implements the following function: unsigned int hex2Dec(const string& hexString) See the following article which describes an algorithm for how to
Create a C++ program that implements the following function:
unsigned int hex2Dec(const string& hexString)
See the following article which describes an algorithm for how to convert from hexadecimal to decimal:
http://www.binaryhexconverter.com/hex-to-decimal-converter (Links to an external site.)Links to an external site.
The function should throw an invalid_argument exception if the string is not composed of hexadecimal characters.
From main, test the function by allowing the user to pass strings to the function inside a loop. Make sure to handle any exceptions that occur!
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
