Are parentheses needed in the percentage grade formula? If so, rewrite the assignment to percentageGrade, adding parentheses where necessary
// This program determines the percentage grade on
// an exam, given the number of questions missed,
// how many points each question was worth,
// and the total points possible.
#include
using namespace std;
int main()
{
int pointsPerQuestion;
int numberMissed;
double percentageGrade;
double pointsPossible;
cout << "Enter the total points possible on the exam => ";
cin >> pointsPossible;
cout << endl;
cout << "Enter the number of points per question => ";
cin >> pointsPerQuestion;
cout << endl
cout <<"Enter the number of questions missed => ";
cin >> numberMissed;
percentageGrade = pointsPossible - numberMissed * pointsPerQuestion / pointsPossible * 100;
cout << endl << "The percentage grade is ";
cout << percentageGrade << "%";
return 0;
}
percentageGrade = ( pointsPossible - numberMissed * pointsPerQuestion ) / pointsPossible * 100;
Computer Science & Information Technology
You might also like to view...
A(n) ___________________ variable belongs to a specific object.
Fill in the blank(s) with the appropriate word(s).
Computer Science & Information Technology
What are some of the most popular scanner tools?
What will be an ideal response?
Computer Science & Information Technology
The difference between the SUMIF and SUMIFS functions is that SUMIFS can specify only one criterion for summing the range
Indicate whether the statement is true or false.
Computer Science & Information Technology
A user's laptop fan is making an unusually high pitched noise. "The FIRST step would be to:
A. Contact the manufacturer's technical support. B. Remove the bottom of the laptop to view the fan. C. Blow compressed air through the fan slot out of the computer. D. Replace the fan
Computer Science & Information Technology