Site icon Tutor Bin

Iowa State University Create a Java Code Loop Exercise Method

Iowa State University Create a Java Code Loop Exercise Method

Description

Returns a year with the highest value, given a string containing pairs
* of years and values (doubles). If there are no pairs, the method returns
* -1. In the case of a tie, the first year with the highest value is
* returned. Assumes the given string follows the correct format.
* <p>
* For example, given the following string, the year 1995 is returned.
* <pre>
* 1990 75.6 1991 110.6 1995 143.6 1997 62.3
* </pre>
*
* @param data given string containing year-value pairs
* @return first year associated with the highest value, or -1 if no pair
* given
*/
public static int maxYear(String data)

Have a similar assignment? "Place an order for your assignment and have exceptional work written by our team of experts, guaranteeing you A results."

Exit mobile version