Description:
Recursion: Decimal to given base from 2 till 36 for example octal or hexadecimal
Write a program that asks the user to converts a decimal number to a given base b, where b is between 2 and 36. There are 2 other number systems, octal (base 8) and hexadecimal (base 16).
The digits in octal number system are 0, 1, 2, 3, 4, 5, 6 and 7.
The digits in hexadecimal system are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E and F.
So A in hexadecimal is 11, B in hexadecimal is 12 and so on.
For example, base 20 numbers are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F, G, H, I and J.
Modify the following program to achieve the above requirements.
The program must work on Visual C++ and be a Win32 Console Application.
#include <iostream>
using namespace std;
void decToBin(int num, int base);
int main()
{
int decimalNum;
int base;
base = 2;
cout<<"Enter number in decimal: ";
cin>>decimalNum;
cout<<endl;
cout<<"Decimal "<<decimalNum<<" = ";
decToBin(decimalNum,base);
cout<<" binary"<<endl;
return 0;
}
void decToBin(int num, int base)
{
if(num > 0)
{
decToBin(num/base, base);
cout<
Deliverables: FULL DOCUMENTATION.
Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.
Complete copyrights to all work purchased.
Platform:
The program must work on Visual C++ and be a Win32 Console Application. Win ME
Must be 100% finished and received by buyer on:
Time legal notes: All times are expressed in the time zone of the site EST (GMT - 5). If the buyer omitted a time, then the deadline is 11:59:59 PM EST on the indicated date.
5/4/2002 8:00:00 PM
Remember that contacting the other party outside of the site (by email, phone, etc.) on all business projects < $500 (before the buyer's money is escrowed) is a violation of both the software buyer and seller agreements.
We monitor all site activity for such violations and can instantly expel transgressers on the spot, so we thank you in advance for your cooperation.
If you notice a violation, you can report it to: abuse@rentacoder.com.
|