this pic is methods , please help with the inputs.(I have copied the code) packa
ID: 3686341 • Letter: T
Question
this pic is methods , please help with the inputs.(I have copied the code)
package code;
import java.util.ArrayList;
public class Inputs {
// Study the definition of the method
// method_6
// defined in the class Methods.
// Define the following method so it returns a value which,
// if passed as an argument to method_6,
// causes method_6 to return the value "correct".
public ArrayList<String> inputForMethod_6() {
return null;
}
// Study the definition of the method
// method_7
// defined in the class Methods.
// Define the following method so it returns a value which,
// if passed as an argument to method_7,
// causes method_7 to return the value "yes".
public ArrayList<String> inputForMethod_7() {
return null;
}
// Study the definition of the method
// method_8
// defined in the class Methods.
// Define the following method so it returns a value which,
// if passed as an argument to method_8,
// causes method_8 to return the value "right".
public ArrayList<String> inputForMethod_8() {
return null;
}
// Study the definition of the method
// method_9
// defined in the class Methods.
// Define the following method so it returns a value which,
// if passed as an argument to method_9,
// causes method_9 to return the value true.
public String inputForMethod_9_A() {
return null;
}
// Study the definition of the method
// method_9
// defined in the class Methods.
// Define the following method so it returns a value which,
// if passed as an argument to method_9,
// causes method_9 to return the value false.
public String inputForMethod_9_B() {
return null;
}
}
Explanation / Answer
import java.util.ArrayList; class Inputs { // Study the definition of the method // method_6 // defined in the class Methods. // Define the following method so it returns a value which, // if passed as an argument to method_6, // causes method_6 to return the value "correct". public ArrayList inputForMethod_6() { ArrayList input = new ArrayList(); input.add("c"); input.add("oo"); input.add("rrr"); input.add("rrrr"); input.add("eeeee"); input.add("eeeeee"); input.add("ccccccc"); input.add("tttttttt"); ArrayList output = new ArrayList(); output.add(method_6(input)); return output; } // Study the definition of the method // method_7 // defined in the class Methods. // Define the following method so it returns a value which, // if passed as an argument to method_7, // causes method_7 to return the value "yes". public ArrayList inputForMethod_7() { ArrayList input = new ArrayList(); input.add("yy"); input.add("eeee"); input.add("ssssss"); ArrayList output = new ArrayList(); output.add(method_7(input)); return output; } // Study the definition of the method // method_8 // defined in the class Methods. // Define the following method so it returns a value which, // if passed as an argument to method_8, // causes method_8 to return the value "right". public ArrayList inputForMethod_8() { ArrayList input = new ArrayList(); input.add("r"); input.add("iii"); input.add("ggggg"); input.add("hhhhhhh"); input.add("ttttttttt"); ArrayList output = new ArrayList(); output.add(method_7(input)); return output; } // Study the definition of the method // method_9 // defined in the class Methods. // Define the following method so it returns a value which, // if passed as an argument to method_9, // causes method_9 to return the value true. public String inputForMethod_9_A() { String output = method_9("malayalam") ? "true" : "false"; return output; } // Study the definition of the method // method_9 // defined in the class Methods. // Define the following method so it returns a value which, // if passed as an argument to method_9, // causes method_9 to return the value false. public String inputForMethod_9_B() { String output = method_9("hello") ? "true" : "false"; return output; } }Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.