Im wondering what I need to do to fix this problem....here 's the piece of code:
private static int checkDigits(Str ing choice2) {
char[] chars = String.valueOf( choice2).toChar Array();
int check = 0;
for (int j = 0; j < chars.length; j++)
check += Integer.parseIn t(String.valueO f((int)pow(10, 14-j)*chars[j]));
int digit = Integer.parseIn t(String.valueO f(chars[14]));
return digit;
}
}
Basically, i need to implement the Airline Ticket check digit scheme....and we need to save it in a char array but i need to use the power function and its giving me this error:
"The method pow(int, int) is undefined for the type AirTicketNums"
How do I solve this? I tried casting and nothing...
private static int checkDigits(Str ing choice2) {
char[] chars = String.valueOf( choice2).toChar Array();
int check = 0;
for (int j = 0; j < chars.length; j++)
check += Integer.parseIn t(String.valueO f((int)pow(10, 14-j)*chars[j]));
int digit = Integer.parseIn t(String.valueO f(chars[14]));
return digit;
}
}
Basically, i need to implement the Airline Ticket check digit scheme....and we need to save it in a char array but i need to use the power function and its giving me this error:
"The method pow(int, int) is undefined for the type AirTicketNums"
How do I solve this? I tried casting and nothing...
Comment