Question
package loops; import java.util.List; public class ListHasGreater { /** * Returns true if the first argument contains a number greater than the * second argument;
package loops;
import java.util.List;
public class ListHasGreater {
/** * Returns true if the first argument contains a number greater than the * second argument; returns false otherwise. * @param numbers A list of numbers * @param number A number to compare * @return whether first parameter contains a number greater than the * second parameter */ public static boolean hasGreaterFor(List
/** * Returns true if the first argument contains a number greater than the * second argument; returns false otherwise. * @param numbers A list of numbers * @param number A number to compare * @return whether first parameter contains a number greater than the * second parameter */ public static boolean hasGreaterWhile(List
/** * Returns true if the first argument contains a number greater than the * second argument; returns false otherwise. * @param numbers A list of numbers * @param number A number to compare * @return whether first parameter contains a number greater than the * second parameter */ public static boolean hasGreaterForEach(List
/** * Returns true if the first argument contains a number greater than the * second argument; returns false otherwise. * @param numbers A list of numbers * @param number A number to compare * @return whether first parameter contains a number greater than the * second parameter */ public static boolean hasGreaterDoWhile(List
Loops Implement the functions hasGreaterfor, hasGreaterwhile, hasGreaterForEach and hasGreaterDowhile according to the provided Javadoc for each function. The Javadoc and desired behaviour of each function is identical, however each method must use a different type of loop, as specified below: hasGreater For - for loop hasGreaterWhile - while loop hasGreater ForEach - for-each ("enhanced for") loop hasGreaterDowhile-do-while loop Note: This question may take a while to run
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started