Answer:
The method in C++ is as follows:
double average(int v, int w, int x, int y, int y){
double ave = (v+w+x+y+z)/5.0;
return ave;
}
Explanation:
This defines the average method with 5 parameters
double average(int v, int w, int x, int y, int y){
This calculates the average
double ave = (v+w+x+y+z)/5.0;
This returns the calculated average
return ave;
}
To call the method from the program's main, use:
<em>int main(){</em>
<em> cout<<average(1,5,7,4,10);</em>
<em> return 0;</em>
<em>}</em>
<em />