Sign in to follow this  
Sean Frazier

Need help on a java problem

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this