Question: C + + pls; gives the hex 2 Dec ( const string& hexString ) function that returns a decimal number from a hex string. Implement

C++ pls;
gives the hex2Dec(const string& hexString) function that returns a decimal number from a hex string. Implement the hex2Dec function to throw a invalid_argument exception if the string is not a hex string. Write a test program that prompts the user to enter a hex number as a string and display the number in decimal. If the function throws an exception, display "Not a hex number".

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!