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

 

abraskin@mbusd.org 2016_student_creations_01 > simpleAddition
prev  |  next  |  chance

Create a method that, when given three ints, can return their total as a String. However, if the sum total of all the numbers, one of the numbers, or the total of two of the numbers is divisible by two, the method should return "CAN NOT COMPUTE".
Example:
3, 4, 5 output: "12"
7, 81, 5 output: "CAN NOT COMPUTE"
5, 10, 9 output: "CAN NOT COMPUTE"
5, 5, 19 output: "CAN NOT COMPUTE"
5, 3, 22 output: "CAN NOT COMPUTE"


simpleAddition(90, 3, 7) → "CAN NOT COMPUTE"
simpleAddition(379, 1, 44) → "CAN NOT COMPUTE"
simpleAddition(3, 45, 5) → "CAN NOT COMPUTE"

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

public String simpleAddition(int a, int b, int c) }

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

Copyright Nick Parlante 2017 - privacy