Question: Write the C++ code for a function that receives four items of information: three by value and one by reference. Each item has the double

Write the C++ code for a function that receives four items of information: three by value and one by reference. Each item has the double data type. Name the formal parameters num1, num2, num3, and avg. The function should calculate the average of the three numbers and then assign the result to the avg variable. Name the function calcAverage. Also write an appropriate function prototype for the function. In addition, write a statement that invokes the function, passing it the following actual arguments: janAvg, febAvg, marAvg, and quarterAvg.

Step by Step Solution

3.29 Rating (161 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

void calcAveragedouble num1 double num2 double num3 do... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Microsoft Visual C# Introduction Questions!