Question
Your program should be in a new project named Program 3: Number System Conversion and should be in a package named numberSystem. Your program must
Your program should be in a new project named "Program 3: Number System Conversion" and should be in a package named "numberSystem". Your program must be in a file called "Program3NumberConversion.java". Your goal is to convert a number in some other number system (such as binary) to decimal. The base (also known as a radix) will have a maximum of 16. Before beginning your main method, write two other methods: public static int parseNumber (char letter) will basically be a big switch statement. There should be a case for each one of the digits (0-9) as well as a, A, b, B, c, C, d, D, e, E, f ,and F. Each of these should just return their numeric value: 0 is 0, 1 is 1, 2 is 2, ... a and A is 10, b and B is 11, etc. Note that none of these cases need a break statement since they are returning values. The heart of the matter is handled in public static int valueOfDigit(int place, int radix, int number). Remember that Math.pow returns a double, so the result will have to be cast to an integer before it is returned. The math is pretty simple, just consider the following example from the number 43205 . Remember to start with an index of 0 and to start from the right hand side of the number. If the 2nd place of the number in base 5 has value 3, it has a result of 3*(52) or 75. After you have computed the formula, perform the following output before returning the value for error checking: System.out.print(result+"+");. java programming
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started