#Can someone help me with this Methods exercise?
1 messages · Page 1 of 1 (latest)
While you are waiting for getting help, here are some tips to improve your experience:
If nobody is calling back, that usually means that your question was not well asked and hence nobody feels confident enough answering. Try to use your time to elaborate, provide details, context, more code, examples and maybe some screenshots. With enough info, someone knows the answer for sure.
Don't forget to close your thread using the command </help-thread close:1027500463647621170> when your question has been answered, thanks.
Which part are you struggling with?
You're checking the size of the straws
You declare a method
The function will take 3 parameters and return a Boolean
Yup
Int isn't a type in Java
Seems like something you can Google
"Java Int", look at some examples
Detected code, here are some useful tools:
javaif (a == b && a != c) System.out.println("is a triangle")
It doesn't need to be equal
You just need to make sure that the sum of 2 of the sides isn't less than the other side
So yeah, you could make use of if
if the sum of 2 sides is less than the remaining side
If you say it that way, you can tell an if would be useful
Detected code, here are some useful tools:
sumAB = a + bif (sumAB <= c) System.out.println("Is not a triangle")
There ya go, you're getting the hang of it
Closed the thread due to inactivity.
If your question was not resolved yet, feel free to just post a message to reopen it, or create a new thread. But try to improve the quality of your question to make it easier to help you 👍