Define a function named average_grade. This function returns a double and has four double arguments, test1, test2, test3, test4. The return value should be the average, or arithmetic mean of the four arguments. Be sure to include a comment that tells briefly what the function does.
What will be an ideal response?
// returns arithmetic mean of the arguments test1 - test4
double average_grade (double test1-, double test2,
double test3, double test4)
{
double average;
average = (test1 + test2 + test3 + test4) / 4;
return average;
Computer Science & Information Technology
You might also like to view...
Which of the following can be created by a programmer?
a. Class-level function b. World-level function c. World-level method d. All of the above e. None of these
Computer Science & Information Technology
In the TCP/IP model, what layer combines the responsibilities of the Application, Presentation, and Session layers from the OSI model?
a. Application b. Internet c. Transport d. Link
Computer Science & Information Technology