pls check this part please
public class RomanNumbers3 { private static BufferedReader br = new BufferedReader(new InputStreamReader( System.in)); public static void main(String[] args) throws IOException { int rN = 0; int equivalent = 0; int[] value; char[] romanChar = {'I'}; System.out.print("Enter a roman number: "); String romanNumber = br.readLine(); value = new int[romanNumber.length()]; romanChar = new char[romanNumber.length()]; // get the values of each of the roman character for (int x = romanNumber.length() - 1; x >= 0; x--) { switch (romanNumber.charAt(x)) { case 'I': rN = 1; break; case 'V': rN = 5; break; case 'X': rN = 10; break; case 'L': rN = 50; break; case 'C': rN = 100; break; case 'D': rN = 500; break; case 'M': rN = 1000; break; default: System.out.println("Invalid Roman Character Sequence"); break; } // IM HAVING SOME PROBLEM WITH CHECKING OF THE CHARACTERS for (int check = romanChar.length - 1; check >= 0; check--) { if (romanNumber.charAt(x) != romanChar[0]) { System.out.println("WRONG CHARACTER"); } } // assign the value according to the sequence of the characters value[x] = rN; } for (int n = romanNumber.length() - 1; n >= 0; n--) { // compute the values according to the sequence of roman characters if ((n != 0) && (value[n] > value[n - 1])) { equivalent = equivalent + (value[n] - value[n - 1]); n--; } else { equivalent = equivalent + value[n]; } } System.out.println(equivalent); } } if i entered 'I' it still displays "WRONG CHARACTER"..when the character in the romanChar[] array has a character 'I' in its index(0) why?,.,.... cant figure it out... please help
what i want here now is to check if there is/ are any illegal character.. so i will display an output for that..