Part 3.
1) Then add a prototype (before the main function) for a function called
calcAverage() with the following prototype.
double calcAverage(int score1,int score2,int score3);
2) In your main function, add a declaration for a variable called average of
type double.
3) Add statement in main(), after the work done in part 2 above, to call the
calcAverage() passing the three scores and then return the average. It will
be something like this:
average = calcAverage(score1,score2,score3);3
4) Add definition for your calcAverage() function by taking in the three values
passed and then calculate and return the value for average.
5) After the statement done in step 3 of this task (above) add a statement to
print the value for average returned from the calcAverage() function.
6) Run your program and enter three different scores and check that the average
is calculated (and displayed) correctly.
Do continue if this process is not working correctly.
7) Add documentation for your function; what it does, preconditions and
postconditions.
Its fine,
1)its ok you can re-name functions and the prototype is there.
2)there are a variable of type double called average
3)there is this statement.
4)there is this definition; Read the comments its important
5)You can omit this step cuz after all will be deleted;
1 2 3 4
double average;
average=getAverage(score1,score2,score3); //or calcAverage
cout<<"Average : "<<average<<endl;
//thats all
6) Just run your program
7)Documentation
I change calcAverage by getAverage seems better to my point of view but anyway you can re-name it.