1. Engineering
  2. Computer Science
  3. this program is in java ive done most of the...

Question: this program is in java ive done most of the...

Question details

This Program is in Java. I've done most of the logical steps of the program but I am having trouble on what to and how to return a boolean method. I know it's a rookie thing to get stuck on but I am new to Java and this is one of the challenges I'm doing for myself. Thank you in advance!

Equal Sum Checker Write a method hasEqualSum with 3 parameters of type int The method should return boolean and it needs to return true if sum of first and second parameter is equal to third parameter. Otherwise return false. EXAMPLES OF INPUT/OUTPUT: hasEqualSum(1, 1, 1); should return false since 1 + 1 is not equal to 1 hasEqualSum(1, 1, 2); should return true since 1+ 1 is equal to 2 hasEqualSum(1, -1, 0); should return true since 1 (-1) is 1 - 1 and is equal to 0 NOTE:The hasEqualSum method needs to be defined as public static like we have been doing so far in the course. NOTE: Do not add a main method to solution code.

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution