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

 

sep9_2016_APSLHL_addMaybe


Write a method that returns the sum of the two integer parameters, but ONLY if the second parameter is greater than the first parameter. If the second parameter is less than or equal to the first parameter, then only return the value of the first parameter. Look at the test data for examples.


sep9_2016_APSLHL_addMaybe(5, 6) → 11
sep9_2016_APSLHL_addMaybe(4, 4) → 4
sep9_2016_APSLHL_addMaybe(4, 7) → 11

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

public int sep9_2016_APSLHL_addMaybe(int a, int b) { }

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

Copyright Nick Parlante 2017 - privacy