language: Java (sun-jdk-1.7.0_10)
date: 240 days 3 hours ago
link:
visibility: private
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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());
                        }
                }
        }
 
}
 
Main.java:21: cannot find symbol
symbol  : class ReadFile
location: class Main
				ReadFile file = new ReadFile(file_name);
				^
Main.java:21: cannot find symbol
symbol  : class ReadFile
location: class Main
				ReadFile file = new ReadFile(file_name);
				                    ^
2 errors