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

 

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

Write a method that returns the sum of the two integer input parameters, with the following exceptions: #1 if the sum is negative, subtract 10 from the total. So -3 and -5 would result in -18 (since they sum to -8, but then you have to subtract 10 because the sum was negative). #2 if the sum is exactly 5, you must return 5000 instead! Please look at the test data carefully to make sure you understand the directions.


aaa1funnySum(5, 6) → 11
aaa1funnySum(-3, -2) → -15
aaa1funnySum(-6, 1) → -15

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

public int aaa1funnySum(int a, int b) { }

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

Copyright Nick Parlante 2017 - privacy