Need help on a java problem

Started by
2 comments, last by rip-off 11 years, 1 month ago

I have a java problem for class and I Have no idea where to begin with it. the problem is

Write a while loop that accepts numbers from a user and sum only the numbers that
are odd? The loop quits if the given input number is -9999.
any help would be greatly appreciated
Advertisement
Homework is generally not allowed on the forums.

If you get stuck on a specific item of your homework you can post your code and look for a bug.

In this case you can start by reading in a number and then writing a loop. If you need more help then that you should probably talk with your instructor. That way your instructor will know what topics you know and which you are struggling on, and then he can tailor your class to suit your needs.

Moderator note: please do not post solutions. There is a middle ground for answering such questions, which mostly involves asking the OP for their code, and maybe pointing out bugs in their current implementation.

Also tips such as how to use a debugger or "printf debugging" would be acceptable.

@Sean12111

What code do you have at the moment?

This topic is closed to new replies.

Advertisement