Overload the function ComputeGrade to have as input two HWs

Overload the function ComputeGrade to have as input two HWs. One midterm, and one final grade. One of the functions should be all doubles and the others should be integers. The function should calculate the average grade using these numbers and return it. You don\'t have to write the main() function. In the code below, label the local and the global variables by circling them and writing global or local. #include int a = 1550; void myFuncil; int main [] {int a = 5; std;;cout

Solution

The second one is half complete it seems. Anyways, here is the solutions for you:

char ComputeGrade(double hw1, double hw2, double midterm, double finalGrade)
{
double sum = hw1 + hw2 + midterm + finalGrade;
if(sum >= 90)
return \'A\';
else if(sum >= 80)
return \'B\';
else if(sum >= 70)
return \'C\';
else if(sum >= 60)
return \'D\';
else
return \'F\';
}
char ComputeGrade(int hw1, int hw2, int midterm, int finalGrade)
{
double sum = hw1 + hw2 + midterm + finalGrade;
if(sum >= 90)
return \'A\';
else if(sum >= 80)
return \'B\';
else if(sum >= 70)
return \'C\';
else if(sum >= 60)
return \'D\';
else
return \'F\';   
}
#include <iostream>
int a = 1550;    //global variable.
void myFunc();
int main()
{
int a = 5;    //local variable.
std::cout<<\"In main:\\t\"<<a<<\"\\t\"<<::a<<\"\ \";
myFunc();
{
int a = 455;    //local variable.
}

 Overload the function ComputeGrade to have as input two HWs. One midterm, and one final grade. One of the functions should be all doubles and the others should

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site