Different data types than return value in function?
<p>Ok I am a bit confused here on a program i made for school. The program executes and i get my desired results but i just think something could be better. In my <code>findLowest()</code> function it has an <code>int</code> return. Well the data types that i am passing into it in the arguments are <code>double</code>. Can a function with one return type have different data type arguments? Or shall i say is there a neater way to do this, maybe casting? I would not have a problem but find lowest needs to be called by <code>calcAverage()</code> which leaves me stumped because if i changed the data members than obviously the right data would not be passed to and from each function. Here is the code snippet from the program, thanks for any ideas in advance, if need be it can always be left as is, it works.</p>

<pre><code>//function averages input test scores
void calcAverage(double score1, double score2, double score3, double score4, double score5)
{   
    //call to findLowest() function to decide which score to omit

        double lowest = findLowest(score1, score2, score3, score4, score5); 

        double average = ((score1 + score2 + score3 + score4 + score5) - lowest) / 4;

        cout &lt;&lt; "Average is: " &lt;&lt; average &lt;&lt; endl;

}

//determines which input score is lowest 
int findLowest(double score1, double score2, double score3, double score4, double score5)
{

    double low = score1;    

    if(score2 &lt; low)
        low = score2;
    if(score3 &lt; low)
            low = score3;
    if(score4 &lt; low)
        low = score4;
    if(score5 &lt; low)
        low = score5;

    cout &lt;&lt; "Lowest score is: " &lt;&lt; low &lt;&lt; endl;


return low;
}
</code></pre>
