Question
The output format should look as follows (given Input: IFEBA):
Encoded: 89579953
Decoded:
IFEBA
The logic should include the following:
1. Prompt for and read the input string into a variable, input.
2. Use the string method input.charAt(n)to extract the nth character from the
string, where n is 0, 1, 2, 3, 4.
3. Convert each character to its numeric value. This can be done by using the
formula (valid for ‘A’-‘I’) value = character – ‘A’ + 1 (note arithmetic can be
done on Java Unicode characters)
4. Use the 5 values as digits in a base 56 number and calculate the resuing value
(the digit corresponding to c1 being the most significant digit). This can be
done by aernating muiplication by the base and adding the next digit.
I don’t understand how to calculate the letter to number. Would you mind to hint me something?
Engineering Technology