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;
```
You might also like to view...
Which of the following is true?
a. RAM is where the CPU is located. b. Intel is the only manufacturer of CPUs. c. The CPU contains the ALU. d. The Windows System Properties window tells you how much memory you should buy.
Category 6 is an example of a ________ used to connect wired network devices
A) cable B) protocol C) packet D) token
Suppose that the video store has the following accounts: Owner, Employee,and User. Specify GRANT statements appropriate for each account.
This question is formulated with a pitfall: the student is supposed to recognize that users should not be granted any privileges, because a user should be allowed to see only the data pertaining to that particular user.
The wildcard that substitutes for a single character is the ________ wildcard
A) number sign B) brackets C) asterisk D) question mark