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

 

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

Write a method that has two integer input parameters and a boolean input parameter called justEven. Return the sum of the two integers unless justEven is true. In that case, only include the even numbers in the sum.


addNumsProg3Dec2011(5, 6, false) → 11
addNumsProg3Dec2011(5, 6, true) → 6
addNumsProg3Dec2011(8, 2, true) → 10

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

public int addNumsProg3Dec2011(int a, int b, boolean justEvens) { }

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

Copyright Nick Parlante 2017 - privacy