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

 

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

Write a method that returns the sum of the two integer parameters. However, if the two numbers do not have the same value, the largest number gets doubled. For example, if the two numbers are 5 and 8, the value returned would be 21 since the 8 would get doubled to 16 then 5 is added to that to get 21.


nov9_2016_APSLHL_sumNumsDoubleGreater(4, 4) → 8
nov9_2016_APSLHL_sumNumsDoubleGreater(7, 2) → 16
nov9_2016_APSLHL_sumNumsDoubleGreater(9, 10) → 29

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

public int nov9_2016_APSLHL_sumNumsDoubleGreater(int num1, int num2) { }

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

Copyright Nick Parlante 2017 - privacy