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

 

Logic-1 > teenSum
prev  |  next  |  chance

Given 2 ints, a and b, return their sum. However, "teen" values in the range 13..19 inclusive, are extra lucky. So if either value is a teen, just return 19.


teenSum(3, 4) → 7
teenSum(10, 13) → 19
teenSum(13, 2) → 19

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

public int teenSum(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: 127.0

Copyright Nick Parlante 2017 - privacy