Question: Java Python Logic-1 > teenSum prev next | chance Given 2 ints, a and b, return their sum. However, teen values in the range 13..19


Java Python 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. teen Sum(3, 4) +7 teenSum(10, 13) 19 teenSum(13, 2) 19 Go ...Save, Compile, Run (ctrl-enter) public int teenSum(int a, int b) { } Java Python Logic-1 > maxMod5 prev next chance Given two int values, return whichever value is larger. However if the two values have the same remainder when divided by 5, then the return the smaller value. However, in all cases, if the two values are the same, return O. Note: the % "mod" operator computes the remainder, e.g. 7 % 5 is 2. maxMod5(2, 3) 3 maxMod5(6, 2) 6 maxMod5(3, 2) 3 Go ...Save, Compile, Run (ctrl-enter) public int maxMod5(int a, int b) {
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
