I'm developing a dictation program in which I try to compare text entered by a student to the correct text but I have errors on compiling which doesn't make sense to me.
CODE:
String[] list_answer = exercise_english_1.answer.split("\\s+");
String[] list_responce = exercise_english_1.response.split("\\s+");
ArrayList<String> list_error = new ArrayList<String>();
for(int i = 0; i < list_answer.length(); ++i) {
if (list_responce[i].equals(list_answer[i]))
exercise_english_1_statistics.score += (double) 1 / list_answer.length();
else
list_error.add(list_responce[i]);
}
ERRORS:
C:\Users\?????\OneDrive\Java\Project\Prototype\Prototype.java:71: error: cannot find symbol
for(int i = 0; i < list_answer.length(); ++i) {
^
symbol: method length()
location: variable list_answer of type String[]
C:\Users\?????\OneDrive\Java\Project\Prototype\Prototype.java:73: error: cannot find symbol
exercise_english_1_statistics.score += (double) 1 / list_answer.length();
symbol: method length()
location: variable list_answer of type String[]
C:\Users\?????\OneDrive\Java\Project\Prototype\Prototype.java:208: error: cannot find symbol
for(int i = 0; i < list_answer.length(); ++i) {
^
symbol: method length()
location: variable list_answer of type String[]
C:\Users\?????\OneDrive\Java\Project\Prototype\Prototype.java:210: error: cannot find symbol
exercise_french_1_statistics.score += (double) 1 / list_answer.length();
^
symbol: method length()
location: variable list_answer of type String[]
4 errors
PS: Sorry for my bad English, it's not my native language...