Please edit your post and wrap your code with
[code=java]
<YOUR CODE HERE>
[/code]
to get highlighting and preserve formatting.
do you know about arrays or arraylists? They would allow you to have many animals.more than four animals.
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
Please edit your post and wrap your code with
[code=java]
<YOUR CODE HERE>
[/code]
to get highlighting and preserve formatting.
do you know about arrays or arraylists? They would allow you to have many animals.more than four animals.
If you don't understand my answer, don't ignore it, ask a question.
This looks pretty simple in my opinion. Every question is an if statement and every end condition with an animal is an animal guess. For your if statements, the yes branch is your true and the no branch is your else. The example you have has way more than enough information for you to make this happen. I would start by drawing a picture of what is currently there. Maybe that would help you correlate the similarities between the picture and the if statement tree you are trying to build.
Norm, unless i'm missing something i don't see why he would need an array. The level of complication in this assignment isn't anywhere close to that. They just want to figure out if he can copy paste an if statement and keep track of the logic.
Writing code is your job, helping you fix and understand it is mine.
<-- Be sure to thank and REP (Star icon) those who have helped you. They appreciate it!
Please could you give a sample of one of my paths? because i have tried everything and when i test it, it just doesnt work. especially because i cant get past three questions and three animals
please help im desperate
and also i have two public static void main(String[] args) in my code sorry.
I got the program, will be asking for help in whats wrong with my code, thankyou for the help