#### Step 1. Place your order

Fill in the order form and provide all details of your assignment.

#### Step 2. Make Payment

Choose the payment system that suits you most.

#### Step 3. Receive your paper

# When a number

**Place your order now for a similar assignment and have exceptional work written by our team of experts, At affordable rates**

**For This or a Similar Paper Click To Order Now**

1.7 Background on bases

Every number, when written or represented in text, uses a base representation. For example, the number 255 means

2

×

10

2

+

5

×

10

1

+

5

×

10

0

because we are using base-10 representation.

When a number

y

is written in base

n

as

d

m

d

m

−

1

.

.

.

d

2

d

1

d

0

then

y

can be calculated as

y

=

i

=

m

∑

i

=

0

d

i

n

i

and in addition, we restrict the values of the digits as follows:

The first digit satisfies

0

<

d

m

<

n

and all others have

0

≤

d

i

<

n

2 Convertbase

Write a program convertbase.cpp which converts a number, represented as a string in one base, to a new string representing that number in a new base. You may assume that the number can be stored in an int without overflow.

The character to represent a digit with value digitvalue is the ASCII character digitvalue+'0'.

Note that this means that the conventional use of a-f for bases like 16 is not supported by convertbase.

The program should expect three command line arguments

a string representing the number to convert

the base that the preceeding string is represented in

the base that the number should be converted to.

The values of the original base and the target base will always be in the range 2 to 200 inclusive.

The program should print the new representation to the standard output and then exit.

2.1 Restrictions

You may only include the libraries iostream and string. No other includes are permitted.

**Place your order now for a similar assignment and have exceptional work written by our team of experts, At affordable rates**