CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 11 of 11
  1. #1
    Join Date
    Dec 2010
    Posts
    7

    [RESOLVED] Help with basic number average program

    I have made a basic program that figures out averages for a single sport statistic such as goals, but i would like to incorporate ideas such as assists etc into the program but everything i have tried so far has given me multiple errors so I am deff not taking the right approach. Do I need to be running loops or what needs to happen so that once the average for goals has been computed that I can move on to assists etc?

    Thank you in advance.

  2. #2
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,637

    Re: Help with basic number average program

    Do the same thing for assists that you do for goals. You'll need to be more descriptive about what you've tried and what went wrong if you need help.

  3. #3
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: Help with basic number average program

    I think he means "assists" in the sports sense, but I'm not sure how that helps to describe his problem.

  4. #4
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,637

    Re: Help with basic number average program

    Quote Originally Posted by Lindley View Post
    I think he means "assists" in the sports sense, but I'm not sure how that helps to describe his problem.
    I figured that out and changed my post.

  5. #5
    Join Date
    Dec 2010
    Posts
    7

    Re: Help with basic number average program

    My issue right now is when I try to do the same thing for other categories as I have for my first one the program will not even open and run. I am likely placing the code in the wrong areas, I am trying to have three categories for the statistics, it runs perfect with one category right now but I am having trouble figuring out where to place the code to do the next two categories.

  6. #6
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,637

    Re: Help with basic number average program

    Quote Originally Posted by Ruthless View Post
    My issue right now is when I try to do the same thing for other categories as I have for my first one the program will not even open and run. I am likely placing the code in the wrong areas, I am trying to have three categories for the statistics, it runs perfect with one category right now but I am having trouble figuring out where to place the code to do the next two categories.
    Okay, and since you haven't shown us what you're doing, what do you expect us to do to help you?

  7. #7
    Join Date
    Aug 2005
    Location
    San Diego, CA
    Posts
    1,054

    Re: Help with basic number average program

    Great now format the code, copy and paste it back into the edit box, highlight it, and press the # key so that it is placed within code tags.

  8. #8
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,637

    Re: Help with basic number average program

    The code doesn't compile. You have fill_array implemented twice.

  9. #9
    Join Date
    Dec 2010
    Posts
    7

    Re: Help with basic number average program

    Quote Originally Posted by GCDEF View Post
    The code doesn't compile. You have fill_array implemented twice.
    Right, when I delete the last fill_array the program runs fine. But i am back to only handling one statistical category, do i need to write code in the first fill_array?

    Very new to programming, thank you for your patience.

  10. #10
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,637

    Re: Help with basic number average program

    Quote Originally Posted by Ruthless View Post
    Right, when I delete the last fill_array the program runs fine. But i am back to only handling one statistical category, do i need to write code in the first fill_array?

    Very new to programming, thank you for your patience.
    One of the features of a function is that you call it with different arguments so it performs the same operations on different data. Call it the first time passing in your goals array. Call it the second time passing in your assists array.

  11. #11
    Join Date
    Dec 2010
    Posts
    7

    Re: Help with basic number average program

    Quote Originally Posted by GCDEF View Post
    One of the features of a function is that you call it with different arguments so it performs the same operations on different data. Call it the first time passing in your goals array. Call it the second time passing in your assists array.
    Ok, thank you very much for your time and help. I understand what I need to do now. Thank you again, this thread can be closed.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured