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

 

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

Write a method that returns the sum of the two numbers 'num1' and 'num2' UNLESS the two numbers are equal. If they are equal, instead return the product of those two numbers.


test2022_09_12_APP1SLHL_funnyAddition(5, 6) → 11
test2022_09_12_APP1SLHL_funnyAddition(4, 2) → 6
test2022_09_12_APP1SLHL_funnyAddition(200, 1) → 201

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

public int test2022_09_12_APP1SLHL_funnyAddition(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: 200

Copyright Nick Parlante 2017 - privacy