Calculate the score needed on a final exam to achieve a desired grade in a class.

What will be an ideal response?

```
int main()
{
char grade; // grade desired
double minpercent, // minimum average required for that grade
currentave, // current grade average
finalpercent; // % of the total score the final is worth
cout << endl << "Enter desired grade=> ";
cin >> grade;
cout << "Enter minimum average required for a " << grade << "=>";
cin >> minpercent;
cout << "Enter your current average in the course=> ";
cin >> currentave;
cout << "Enter how much the final counts as a percentage" << endl
<< "of the course grade=> ";
cin >> finalpercent;
double finalfract = finalpercent / 100.0;
double needed = (minpercent - currentave * (1.0 - finalfract))
/ finalfract;
cout << endl << "You need a score of " << needed
<< " on the final to get a " << grade <<"." << endl << endl;
return 0;
```

Computer Science & Information Technology

You might also like to view...

A document can be displayed in Outline view by clicking Outline in the status bar or clicking the View tab

Indicate whether the statement is true or false

Computer Science & Information Technology

Which statement would be used to declare a 10-element integer array c?

a. array c<12; b. array c; c. array<12>c d. arrayc;

Computer Science & Information Technology