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

 

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

Write a method that returns the sum of three integer parameters, however, only include the last number in the sum if that number is at least double the sum of the first two numbers. Look at the test data for examples.


oct18_2016_APSLHL_conditionalSum(400, 0, 500) → 400
oct18_2016_APSLHL_conditionalSum(9, -4, 10) → 15
oct18_2016_APSLHL_conditionalSum(-3, 2, 7) → 6

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

public int oct18_2016_APSLHL_conditionalSum(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: 245

Copyright Nick Parlante 2017 - privacy