Pick any 5 of the following 12 essay questions to answer. Important: Do not answer more than 5 total essay questions. Erase/cross out the answers you do not want to be graded. Only the first 5 answered questions will be graded.
Blog
Review the error free lines of code below.
Review the error free lines of code below.
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
As you’ve seen throughout this course, not every program we…
As you’ve seen throughout this course, not every program we write must have some sort of exception handling code. Give one benefit exceptions provide programmers.
Java allows methods to call other methods. To keep track of…
Java allows methods to call other methods. To keep track of method calls, Java utilizes a(n) … (circle only one)
[Extra Credit] There exists a set of 2 nested for loops such…
[Extra Credit] There exists a set of 2 nested for loops such that the runtime complexity of the 2 nested loops is cubic.
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.
The growth rate of binary search is ________________________…
The growth rate of binary search is _____________________________ because we divide the array by half in every iteration.
Pick one: to sort an array arr of type that implements Compa…
Pick one: to sort an array arr of type that implements Comparable, one would do (for all options, assume all necessary imports for them have been included)
The exception handling code in the following program is poor…
The exception handling code in the following program is poorly structured. State why.