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

 

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

Write a method that has two integer parameters, a and b; followed by a boolean parameter dbl. The method returns the sum of a and b, unless dbl is true; then b counts double so it returns the sum of a+2b in that case.


sumDoubleMaybe(18, 30, true) → 78
sumDoubleMaybe(18, 30, false) → 48
sumDoubleMaybe(-90, -3, false) → -93

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

public int sumDoubleMaybe(int a, int b, boolean dbl) { }

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

Copyright Nick Parlante 2017 - privacy