id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

jebbert@volusia.k12.fl.us > drWhoRatings
prev  |  next  |  chance

Write a method that returns the string with the highest rating. You will be passed a string array and an integer array of the same length. These arrays may be empty, in which case you must return an empty string. Otherwise return the string that has the greatest number associated with it. If there are ties for the highest rating, return the FIRST of these strings that tied. Always remember to look carefully at the test data before you get too far into your code.


drWhoRatings(["A", "B", "C", "D", "E", "F"], [45, 128, -34, 128, 128, 45]) → "B"
drWhoRatings(["y", "y", "z"], [-7, -7, -6]) → "z"
drWhoRatings(["run", "jump", "hide", "smile, we're alive!"], [2, 2, 2, 4]) → "smile, we're alive!"

...Save, Compile, Run (ctrl-enter)

public String drWhoRatings(String[] strs, int[] score) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 250

Copyright Nick Parlante 2017 - privacy