#challenge

21 messages · Page 1 of 1 (latest)

scenic gorge
#

am i on the right track

jagged mesaBOT
#

This post has been reserved for your question.

Hey @scenic gorge! Please use /close or the Close Post button 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.

scenic gorge
#
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;
    }
  }
}

}```
rain lotus
#

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:

scenic gorge
#

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;
    }
  }
}
rain lotus
#

first, iterate from 5 to a 20.
Then, call isEqual with the current number. Print it if equal

rain lotus
#

also, your System.out is unreachable since the return statement above it will exit the function

scenic gorge
scenic gorge
jagged mesaBOT
# scenic gorge 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.

rain lotus
#

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

scenic gorge
#

i gotchu thanks for all the help tom