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

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 numbers, int number) { // write your code here }

/** * 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 numbers, int number) { // write your code here }

/** * 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 numbers, int number) { // write your code here }

/** * 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 numbers, int number) { // write your code here } }

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

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!