determining what should be placed in function's parameter

This is a discussion on determining what should be placed in function's parameter within the C++ Programming forums, part of the General Programming Boards category; Code: #include <iostream> #include <limits.h> using namespace std; int getValues(void); int findLowest(int, int, int, int, int); float calcAverage(int, int); int ...

1. determining what should be placed in function's parameter

Code:
```#include <iostream>
#include <limits.h>
using namespace std;

int getValues(void);
int findLowest(int, int, int, int, int);
float calcAverage(int, int);

int main ()

{
int gV;
int fL;

float calc;

gV = getValues();

fL = findLowest(gV);

calc = calcAverage(gV, fL);

cout << "The average of the four highest scores "
<< "is  " << calc << endl;

return 0;

}

int getValues (void)
{
int score1;
int score2;
int score3;
int score4;
int score5;

cout << "Enter five test scores" << endl;

cin >> score1;
cin >> score2;
cin >> score3;
cin >> score4;
cin >> score5;

findLowest(score1,
score2,
score3,
score4,
score5);

return score1 && score2 && score3 && score4 && score5;

}

int findLowest(int score1,
int score2,
int score3,
int score4,
int score5)

{
int lowest = INT_MAX;

for (int i = 0; i < 5; i++)
{
if(score1 < lowest)
lowest = score1;

if(score2 < lowest)
lowest = score2;

if(score3 < lowest)
lowest = score3;

if(score4 < lowest)
lowest = score4;

if(score4 < lowest)
lowest = score5;
}

return lowest;

}

float calcAverage(int scores, int lowest_score)

{
return float (scores - lowest_score) / 4;
}```
Help me out, please: I'm not sure what I should enter in the parameters findLowest(); and calc = calcAverage();

2. you should do the getValues fxn stuff in main; otherwise if you want to use another fxn, think about declaring ints in main, and passing them as reference parameters to getValues.

or just call findLowest from getValues, return the lowest number to getValues, and then return that to main.

you can't call findLowest in main like you did, because it takes 5 parameters, not one. and you can't return the scores like you did in getValues.

edit: also, you shouldn't need the for loop in findLowest. also, in calcAverage, you can pass it correctly, but if you want the sum of the scores, then you would have to
Code:
`return score1 + score2 + //etc.`
not the way you did it. you may want to think about it a bit more