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

 

chanr@sfusd.edu mixedpracticeb > sortaSum
prev  |  next  |  chance

Given 2 ints, a and b, return their sum. However, sums in the range 10..19 inclusive, are forbidden, so in that case just return 20.


sortaSum(3, 4) → 7
sortaSum(9, 4) → 20
sortaSum(10, 11) → 21

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

public int sortaSum(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: 115.0 Post-solution available

Copyright Nick Parlante 2017 - privacy