Question: In C + + Code 5 . 6 1 . 1 : LAB: Calculate average Complete the CalcAverage ( ) function that has a double
In C Code
: LAB: Calculate average
Complete the CalcAverage function that has a double vector parameter and returns the average value of the elements in the vector as
an integer.
Ex: If the input vector is:
quad
then the returned average will be:
main.cpp
Hinclude
#include
using namespace std;
CalcAverage takes in a double vector and returns the average value of elements in the vector as an int.
int CalcAveragevector nuns
Type your code here.
int main
vector nuns ;
cout CalcAveragenuns endl; CaLcAverage should return
return ;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
