import java.io.IOException;
import java.util.Scanner;
public class Main {
/**
* @param args
*/
public static void main(String[] args) throws IOException {
// TODO Auto-generated method stub
Scanner user_Input = new Scanner(System.in);
String file_name = "C:/Program Files/VirtualTalk/projectxt.txt";
String commend;
int i;
boolean found = false;
while (true) {
found = false;
System.out.print("User: ");
commend = user_Input.next();
System.out.println(commend);
try {
ReadFile file = new ReadFile(file_name);
String[] aryLines = file.OpenFile();
for (i = 0; (i < aryLines.length) && (found == false); i++) {
found = commend.equals(aryLines[i]);
if (found == true) {
System.out.println("Computer: " + aryLines[i++]);
}
}
if (found == false) {
System.out.println("Computer: Haven't enough data...");
}
} catch (IOException e) {
System.out.println(e.getMessage());
}
}
}
}