Assignment .1
Write a Java program that has at least the following two methods. You should thoroughly test your methods on several values.
• static int baseToDecimal(String num, int radix) - this method should take in a string representing a number and the base (or radix) of that number and should convert that number to its decimal equivalent and return that value as an int. You may assume that radix is a number between 1 and 36.
• static String decimalToBase(int number, int radix) - this method should take in a decimal number as an int and the base (or radix) you wish to convert that number to and return the String version of the decimal number in that base.
Assignment .2
Write a 3-5 page paper discussing the role of binary, octal, decimal, and hexadecimal in computing. At the very least, cover the following topics:
• Why do we need so many different ways to represent data?
• Efficiency related to working with different number bases
When and why might we need to use a base greater than 16?