Question: Hexa 2 Deci vimal is learning musical notes from an ancient script and trying to decode that script. Each symbol is written in 4 digit
Hexa 2 Deci
vimal is learning musical notes from an ancient script and trying to decode that script. Each symbol is written in 4 digit or 5 digit hexadecimal value. Help her by writing a Java code to convert the given musical hexadecimal tone into its corresponding decimal value.
Note: For hexadecimal, number 0 to 9 represents the value zero to nine, and alphabet A to F represents the value ten to fifteen. If any other character found in input, then print "
Sample Input 1:
1D1D1
Sample Output 1:
119249
Sample Input 2:
266F
Sample Input 2:
9839
Sample Input 3:
97M
Sample Input 3:
97M is Invalid
Sample Input 4:
653412
Sample Input 4:
653412 is a 6 digit input
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
