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

 

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

Write a method that returns the sum of the three input parameters. Except this is a "funny sum" which means that if ANY of the three numbers match, return a value of 0 instead of the sum. For example, input values of 5, 1, and 2 would return an 8. However input values of 3, 1, and 3 would return zero since two of the numbers are the same. Also return zero if all three numbers are the same. Look at the test data for examples.


dec16_2019_APP1SLHL_funnySum(5, 6, 4) → 15
dec16_2019_APP1SLHL_funnySum(3, 77, 3) → 0
dec16_2019_APP1SLHL_funnySum(8, 8, 3) → 0

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

public int dec16_2019_APP1SLHL_funnySum(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: 290

Copyright Nick Parlante 2017 - privacy