Program 1

Write a program that given a base b, 2 <= b <= 16, a number in that base, and a new base b', 2 <= b' <= 16, converts the number to the new base. The number should be a positive integer.

You must implement the algorithms discussed in the book and in class.

Your code must run on cslab41.

You should use the algorithms presented in-class and in the book to do this.

I would convert everything to base 10, as an intermediate calculation.

I would treat the numbers as a string.

Any programming language is acceptable, but you must include documentation on how to compile/execute the code, and it must run on cslab41.

When you have completed this assignment, email the code, as well as any documentation to dbennett@edinboro.edu. Please make sure that you identify this as program 1, and that your name is in the code.

Please email only source code. I should be able to recreate the binaries.


Example interaction:
   Please enter the base for your number: 3
   Please enter the number: 120
   Please enter the new base: 9

   120 base 3 is 16 base 9