Question: Please code this using C++. please comment so that i can understand the code thanks. Query the user for a number in base 19, and

Please code this using C++. please comment so that i can understand the code thanks.

Query the user for a number in base 19, and print out the same number in base 12.

The digits in base 19 are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F, G, H, I

The digits in base 12 are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B

Note that the alphabet digits can be either upper or lower case.

The input provided by the user should be read in as a string. And the output should also be constructed as a string (since it may contain alphabet digits). When the number entered is negative, then the program should exit. You can assume that all digits provided by the user are valid digits.

A sample of execution is shown below:

Please enter a number in base 19 (or negative number to quit): h

The number you entered in base 12 is: 15

Please enter a number in base 19 (or negative number to quit): 13

The number you entered in base 12 is: 1A

Please enter a number in base 19 (or negative number to quit): A5

The number you entered in base 12 is: 143

Please enter a number in base 19 (or negative number to quit): 123

The number you entered in base 12 is: 296

Please enter a number in base 19 (or negative number to quit): -1

Good bye

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!