Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Databases And Information Systems 14th East European Conference Adbis 2010 Novi Sad Serbia September 2010 Proceedings Lncs 6295

Authors: Barbara Catania ,Mirjana Ivanovic ,Bernhard Thalheim

2010th Edition

3642155758, 978-3642155758

More Books

Students also viewed these Databases questions

Question

Explain the causes of indiscipline.

Answered: 1 week ago