Program outputs code from multiple methods instead of just one method
<p>I have a Java program that troubleshoots common problems with phones. To do this I have set up a scanner that reads the user input for any keywords. If one of these keywords is found, a method will output from a text file a solution to the problem suggested by that keyword.</p>

<p>My problem is that when I run the program, all the lines from the text file are outputted, from every method, disregarding my input. </p>

<p>Here's the code:</p>

<pre><code>    import java.io.BufferedReader;
    import java.io.FileReader;
    import java.io.IOException;
    import java.util.Scanner;

    public class task2 {

public static void main(String[] args) {

    Scanner scan = new Scanner(System.in);
    System.out.println("What is your problem?");
    String input =  scan.nextLine();
    String[] problems = {"screen", "display", "broken", "cracked", "camera", "flash", "ports"};
    String[] solutions = input.split("broken");

    for(int x=0; x &lt; problems.length; x++){
        if(input.contains("broken")){
            if(input.contains("screen")){
                brokenScreen();
            } else{

            }
            if(input.contains("display")) {
                brokenDisplay();
            } else{

            }
            if(input.contains("camera")) {
                brokenCamera();
            } else{

            }
            if(input.contains("flash")) {
                brokenFlash();
            } else{

            }
            if(input.contains("ports")) {
                brokenPorts();
            } else{

            }
        }
            else{

            }

        if(input.contains("cracked")) {
            if(input.contains("screen")) {
                crackedScreen();
            } else{

            }
        }
        if(input.contains("water")) {
            waterPhone();
        }
        else{
        }
    }

    brokenScreen();
    brokenDisplay();
    crackedScreen();
    brokenCamera();
    brokenFlash();
    brokenPorts();
    waterPhone();
    noSolution();

    }

public static void noSolution() {
    String file = "C:/Users/Nicholas Gawley/workspace/Second Practice Controlled Assessment/src/solutions.txt"; //Location of the text file
    try {
        FileReader filereader = new FileReader(file);
        BufferedReader bufferedreader = new BufferedReader(filereader);
        while((file = bufferedreader.readLine()) != null){
            System.out.println(file);
    }
        bufferedreader.close();
        } catch (IOException e) {
        e.printStackTrace();
    }

}
public static void waterPhone() {
    String file = "C:/Users/Nicholas Gawley/workspace/Second Practice Controlled Assessment/src/solutions.txt";     try {
        FileReader filereader = new FileReader(file);
        BufferedReader bufferedreader = new BufferedReader(filereader);
        while((file = bufferedreader.readLine()) != null){
            System.out.println(file);
    }
        bufferedreader.close();
    } catch (IOException e) {
        e.printStackTrace();
    }
}
public static void brokenPorts() {
    String file = "C:/Users/Nicholas Gawley/workspace/Second Practice Controlled Assessment/src/solutions.txt";     try {
        FileReader filereader = new FileReader(file);
        BufferedReader bufferedreader = new BufferedReader(filereader);
        while((file = bufferedreader.readLine()) != null){
            System.out.println(file);
    }
        bufferedreader.close();
    } catch (IOException e) {
        e.printStackTrace();
    }

}
public static void brokenFlash() {
    String file = "C:/Users/Nicholas Gawley/workspace/Second Practice Controlled Assessment/src/solutions.txt";     try {
        FileReader filereader = new FileReader(file);
        BufferedReader bufferedreader = new BufferedReader(filereader);
        while((file = bufferedreader.readLine()) != null){
            System.out.println(file);

    }
        bufferedreader.close();
    } catch (IOException e) {
        e.printStackTrace();
    }

}
public static void brokenCamera() {
    String file = "C:/Users/Nicholas Gawley/workspace/Second Practice Controlled Assessment/src/solutions.txt";     try {
        FileReader filereader = new FileReader(file);
        BufferedReader bufferedreader = new BufferedReader(filereader);
        while((file = bufferedreader.readLine()) != null){
            System.out.println(file);
    }
        bufferedreader.close();
    } catch (IOException e) {
        e.printStackTrace();
    }

}
public static void crackedScreen() {
    String file = "C:/Users/Nicholas Gawley/workspace/Second Practice Controlled Assessment/src/solutions.txt";     try {
        FileReader filereader = new FileReader(file);
        BufferedReader bufferedreader = new BufferedReader(filereader);
        while((file = bufferedreader.readLine()) != null){
            System.out.println(file);
    }
        bufferedreader.close();
    } catch (IOException e) {
        e.printStackTrace();
    }

}
public static void brokenDisplay() {
    String file = "C:/Users/Nicholas Gawley/workspace/Second Practice Controlled Assessment/src/solutions.txt";     try {
        FileReader filereader = new FileReader(file);
        BufferedReader bufferedreader = new BufferedReader(filereader);
        while((file = bufferedreader.readLine()) != null){
            System.out.println(file);
    }
        bufferedreader.close();
    } catch (IOException e) {
        e.printStackTrace();
    }
}
public static void brokenScreen() {
    String file = "C:/Users/Nicholas Gawley/workspace/Second Practice Controlled Assessment/src/solutions.txt";     try {
        FileReader filereader = new FileReader(file);
        BufferedReader bufferedreader = new BufferedReader(filereader);
        while((file = bufferedreader.readLine()) != null){
            System.out.println(file);
    }
        bufferedreader.close();
    } catch (IOException e) {
        e.printStackTrace();
    }

}
}
</code></pre>

<p>Can anyone please solve this issue? Any help would be greatly appreciated.</p>