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

 

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

Write a method that returns the sum of three numbers, but only include the third number if 'includeNum3' is 'true'. Look at the test data. Please only use ONE return statement.


findSumUCF(5, 2, 10, true) → 17
findSumUCF(5, 2, 10, false) → 7
findSumUCF(3, 1, 100, true) → 104

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

public int findSumUCF(int num1, int num2, int num3, boolean includeNum3) { }

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

Copyright Nick Parlante 2017 - privacy