Question: In java run through eclipse /** * During a heat wave, any sign of lower temperatures is news. This function takes an * array of

In java run through eclipse

/** * During a heat wave, any sign of lower temperatures is news. This function takes an * array of temperatures and an array of the cities where each temperature reading was * recorded. The function should return the name of a city that experienced a temperature * drop. If no city experienced a drop, the function should return null. * * You can assume only 1 city will experience a drop. * * Use maps to solve this problem. * * Example 1: * * Temps: City: * 80 Seattle * 100 LA * 81 Seattle * 99 LA * * The function should return "LA" because it experienced a drop from 100 to 99. * * Example 2: * * Temps: City: * 91 Terre Haute * 92 Terre Haute * 80 Seattle * 93 Terre Haute * 100 LA * 83 Seattle * 93 Terre Haute * 82 Seattle * 105 LA * 85 Seattle * * The function should return "Seattle" because 83 to 82 was a drop. * * Example 3: * * Temps: City: * 91 Terre Haute * 92 Terre Haute * 80 Seattle * * The function should return null because no city had a drop. * * @param temps temperatures recorded in time order * @param names names of the cities where each temperature was taken * @return city that had a temperature drop */ public static String getTemperatureDropCity(int[] temps, String[] tempCity) { return null; }

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!