Question: /** * q5: Write a public static method named q5 that takes an ArrayList of Doubles as a * parameter and returns an ArrayList of
/** * q5: Write a public static method named q5 that takes an ArrayList of Doubles as a * parameter and returns an ArrayList of Doubles. The returned ArrayList will contain all * values from the input ArrayList except those that have a square root within 3.0 of 2.87 * (ie. the target value of the square root is 2.87 and the allowed variance from this target * is 3.0) */
PLEASE USE JAVA, PLEASE DO IT RIGHT!
public static void main(String[] args) {
ArrayList
list.add(1.0);
list.add(2.97);
list.add(100.0);
System.out.println("returned :" + q5(list));
}
this method should returned 100.0
{"correct":false,"feedback":"On input: [1,2.97,100] Grader expected: [100.0]"}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
