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 2 of 2

Thread: Recurring(Looping) Sum, Count and Average

  1. #1
    Junior Member
    Join Date
    Dec 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Recurring(Looping) Sum, Count and Average

    I need help with a problem. I'm stuck at the very beginning

    I need a write a program in which I will enter one Integer at a time and it will return the result counting the Sum, Count and Average

    Something like this

    type> 3
    (sum, count, average) = (3, 1, 3.0)
    type> 1
    (sum, count, average) = (4, 2, 2.0)
    type> 2
    (sum, count, average) = (6, 3, 2.0)

    It also uses the try catch and exceptions

    For example,

    type> 3.141592
    Sorry, 3.141592 doesn't seem to be an integer...

    Can somebody please help me


  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: Recurring(Looping) Sum, Count and Average

    Please post the code you are having problems with.

    Be sure to wrap your code with
    [code=java]
    <YOUR CODE HERE>
    [/code]
    to get highlighting and preserve formatting.
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. [SOLVED] recurring counter inside a method
    By Goldfinch in forum Loops & Control Statements
    Replies: 1
    Last Post: February 3rd, 2012, 11:00 PM
  2. Help with Average and Variables Please =)
    By Raymond Pittman in forum What's Wrong With My Code?
    Replies: 3
    Last Post: October 9th, 2011, 10:02 AM
  3. Moving Average
    By Donieob in forum What's Wrong With My Code?
    Replies: 0
    Last Post: September 3rd, 2011, 08:58 AM
  4. Finding the Average
    By KiwiFlan in forum What's Wrong With My Code?
    Replies: 1
    Last Post: September 16th, 2010, 07:58 PM
  5. Moving average
    By bondage in forum Loops & Control Statements
    Replies: 0
    Last Post: May 7th, 2010, 04:20 AM