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.

Results 1 to 8 of 8

Thread: Trouble understanding what this is asking.

  1. #1
    Junior Member
    Join Date
    Oct 2013
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Trouble understanding what this is asking.

    I'm having trouble understanding exactly what I'm supposed to do with this problem, if anyone could try to explain it that would be very appreciated. Thanks.

    Problem:
    Write a program that accepts a user determined amount of numbers and calculates the product of the odd numbers entered, and also tells what the lowest odd number entered was.


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Trouble understanding what this is asking.

    The user tells you how many numbers he will enter: say 3
    and then enters that number of numbers: 4 5 6
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Junior Member
    Join Date
    Oct 2013
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: Trouble understanding what this is asking.

    So since it says to calculate the product of the odd numbers entered, in your example would it just be 5?

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Trouble understanding what this is asking.

    5 is the only odd number entered. What are the program's requirements for when there is less than 2 odd numbers?
    If you don't understand my answer, don't ignore it, ask a question.

  5. #5
    Junior Member
    Join Date
    Oct 2013
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: Trouble understanding what this is asking.

    It doesn't say anything about that so I'd assume it would just be the number itself.

  6. #6
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Trouble understanding what this is asking.

    Do you understand it now?
    If you don't understand my answer, don't ignore it, ask a question.

  7. The Following User Says Thank You to Norm For This Useful Post:

    daniel95 (October 29th, 2013)

  8. #7
    Junior Member
    Join Date
    Oct 2013
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: Trouble understanding what this is asking.

    Yes and thank you for that, the only thing I'm having trouble with now is how to accept a user determined amount of numbers. I know how to accept a defined amount of numbers but not an amount that can change.

  9. #8
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Trouble understanding what this is asking.

    Read the number into a variable and use the contents of that variable to control the logic.
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Having trouble understanding recursive methods??
    By orbin in forum What's Wrong With My Code?
    Replies: 0
    Last Post: November 17th, 2012, 01:08 AM
  2. Having trouble understanding Int Logs.
    By orbin in forum What's Wrong With My Code?
    Replies: 10
    Last Post: October 10th, 2012, 12:30 PM
  3. Inheritance trouble understanding how to use it?
    By orbin in forum What's Wrong With My Code?
    Replies: 5
    Last Post: July 21st, 2012, 11:24 AM
  4. Replies: 3
    Last Post: July 12th, 2012, 07:11 AM
  5. Having trouble understanding what teacher said for build Tree.
    By javapenguin in forum What's Wrong With My Code?
    Replies: 6
    Last Post: November 16th, 2010, 08:22 PM