Question: public static void execute(BufferedReader r, PrintWriter w) throws IOException, NumberFormatException { // TODO(student): Your code goes here. } in java please!!! 0 ) integer, read

 public static void execute(BufferedReader r, PrintWriter w) throws IOException, NumberFormatException {

public static void execute(BufferedReader r, PrintWriter w) throws IOException, NumberFormatException {

// TODO(student): Your code goes here.

}

in java please!!!

0 ) integer, read in the lines of the file one at a time; print out the first Y lines that are multiples of x, where x>0 is a parameter to the execute method, and Y is the number of lines that are multiples of x2. For example, if x=2 and the input is 4659308multipleofxandx2multipleofxbutnotx2neithermultipleofxnorx2neithermultipleofxnorx2multipleofxbutnotx2multipleofxandx2 Then the output is 46 because Y=2 (there are 2 lines that are multiples of x2=4 ) and 4,6 are the first Y lines that are divisible by x=2. If x=3 with this same example, we would just output 6 as there is only one multiple of 32. If x=5 we would output nothing since there are no multiples of x2=25. For more examples, see the tests in the tests/ directory that have the form lab1-p4-X-in.txt for the input, and the matching lab1-p4-X-out.txt for the expected output. You can see which parameters are used in the local json file, student_config_lab1p4.json, which says that the parameter is 4 for all of these local tests. Tip: Can you define what lines are "selected" here? Being able to express the concept in a clear, unambiguous way is a great first step to understanding the

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!