Through fill in the blank, write the code for a public stati…

Through fill in the blank, write the code for a public static method named findStringInFile. The method receives a File and a String and returns a boolean if the String is present in the file (in any of its lines), false if the String isn’t found. If the file doesn’t exist, the method should propagate a FileNotFoundException. • You must follow the structure by filling in the blanks; you cannot add or remove statements. • Make sure to close every object that should be closed before returning. • Don’t write import statements or a class header. • As part of error handling, use the Scanner’s NoSuchElementException • Use String’s instance method contains (which can accept a String, and returns a boolean) Be sure to number your answers

Write a compareTo method (using the parameterized form of it…

Write a compareTo method (using the parameterized form of it) for the Automata class that uses two instance variables to determine order: alphabet (String) and transitions (int). An Automata is greater than another if it has more transitions. If two Automatas have the same number of transitions, compare the alphabet of the Automata (with the default comparison between two Strings) and return the result of that.