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

 

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

Write a method that returns the value of the greatest integer in the array if the parameter 'greatest' is true. Otherwise return the value of the least integer in the array. There can be any combination of positives, negatives, and zeros in the array. You must NOT initially assume a particular fixed-value for the greatest or least value in the array. You may not get credit for this problem, even if you get "all green" if you do not follow these requirements.


dec18_2017_SLHL_getLargest([167, 235], true) → 235
dec18_2017_SLHL_getLargest([167, 235], false) → 167
dec18_2017_SLHL_getLargest([5, 241, 432, 235, 124, 856, 53, 124, 3], true) → 856

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

public int dec18_2017_SLHL_getLargest(int[] nums, boolean greatest) { }

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