CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2008
    Posts
    1

    averaging arrays

    Hey guys does anyone understand this question.

    (averaging an array) write two overloaded functions that return the average of an array with the follwoing hearders:

    int average(int array[], int size);
    double average(double array[], int size);

    use {1,2,3,4,5,6} and {6.0,4.4,1.9,2.9,3.4,3.5} to test the function

    i dont know where to start!

    thanks

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

    Re: averaging arrays

    Do you know the mathematical definition of an average?

    And, just a thought, perhaps you should start like this:

    Code:
    int average(int array[], int size)
    {
    
    }
    
    double average(double array[], int size)
    {
    
    }
    
    int main()
    {
        int intarray[6] = {1,2,3,4,5,6};
        double doublearray[6] = {6.0,4.4,1.9,2.9,3.4,3.5};
    }

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