Question: use c++ AT&T 6:30 PM ant Detail- Implement a function void convert(int number, int b); The function will output the number in the given base

use c++  use c++ AT&T 6:30 PM ant Detail- Implement a function void
convert(int number, int b); The function will output the number in the

AT&T 6:30 PM ant Detail- Implement a function void convert(int number, int b); The function will output the number in the given base b. It should work for any base from 2 to 36 and any positive number. Use number %b to get the rightmost digit in the given base. Then use number /= b to strip off the rightmost digit. Use a stack (not recursion) to store the digits as you get them. After all the digits are stored on the stack, use a loop to output the digits in correct order. For digits bigger than 9 (i.e. when base is > 10) use char( 'A' - 10 + digit) to output the base-b letter corresponding to the digit. You may #include to use the sti stack class. Or for four extra points, use your own stack class. Submit Assignment Dashboard Calendar To Do Notifications Inbox . AT&T 6:32 PM 4% alls Enter number and base: 12 10 Enter number and base: 12 16 Enter number and base: 256 16 100 Enter number and base: 255 16 FF Enter number and base: 255 8 377 Enter number and base: 255 4 3333 Enter number and base: 255 2 11111111 Enter number and base: 256 24 AG Enter number and base: 240 24 Enter number and base: 1265 1001 Submit Assignment Dashboard Calendar To Do Notifications Inbox

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!