Question
Please code this using C++. don't use array Query the user for a number in base 19, and print out the same number in base
Please code this using C++. don't use array
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started