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

 

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

Return the sum of the three integer parameters, but only as long as they continue to be in strictly increasing order. So the first number will always be included in the sum, but stop adding as soon as a number is not greater than the previous number. For example, if the parameters are 7, 3, 9, the result is 7. If the parameters are 4, 5, 3, the result is 9. Look at the test data for more examples. Note: "Strictly increasing" means that each number is greater than the previous number. The "strictly" part means consecutive numbers can not be equal.


bbb1countTotal(3, 5, 6) → 14
bbb1countTotal(7, 2, 5) → 7
bbb1countTotal(8, 2, 1) → 8

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

public int bbb1countTotal(int a, int b, int c) { }

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: 190

Copyright Nick Parlante 2017 - privacy