Im having arrayoutofbounds error on my code.
import java.io.*;
class s{
public static void main(String args[]) throws IOException{
BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
String[] a = {"X","C","O","M","P","U","T","E","R","S"};
System.out.println("Enter Price: ");
String b = in.readLine();
for(int i=0;i<b.length();i++){
System.out.print(a[b.charAt(i)]);
}
}
}
what am i doing wrong here? The output should be if i input 35, should be MU.