#challenge
21 messages · Page 1 of 1 (latest)
⌛ This post has been reserved for your question.
Hey @scenic gorge! Please use
/closeor theClose Postbutton above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
public class Interaction {
public static void main(String[] args){
int loop = 5;
while (loop =< 20){
loop++;
}
}
public static int isEvenNumber(int check) {
while (check % 2 == 0) {
return True;
System.out.println("number" + check " is even");
else{
return False;
}
}
}
}```
yes, that looks like you're on the right track.
Although your loop still seems a bit all over the place
Try dividing your problem into multiple:
patched it up a lil
public class Interaction {
public static void main(String[] args){
int check = 5;
while (check <= 20){
check++;
}
}
public static boolean isEvenNumber(int check) {
if ((check % 2) == 0) {
return true;
System.out.println("number" + check + " is even");
}
else {
return false;
}
}
}
first, iterate from 5 to a 20.
Then, call isEqual with the current number. Print it if equal
Yes, although you're missing the call to isEvenNumber from inside the loop
also, your System.out is unreachable since the return statement above it will exit the function
.
thanks for the advice appreciate it
If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
OHH
ok i gotchu
Also, don't put the system.out into the isEqual method
I think you're supposed to print from inside of the loop in main
i gotchu thanks for all the help tom