Add an if-else statement displaying a message indicating whether or not the exam was passed. Assume that 60% is the minimum passing grade.
// 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;
}
if (percentageGrade >= 60)
cout << "Exam passed" << endl;
else
cout << "Exam failed" << endl;
Computer Science & Information Technology
You might also like to view...
In an Append query, what happens to any records that violate the Primary key (or any other) rule?
A) The records are rejected. B) A message box appears telling you that you must fix the problematic records before the query can be run. C) New Primary key values are added to the records D) The query pauses at each violating record and allows you to fix the error(s).
Computer Science & Information Technology
The presentation tier of the three-tier structure consists of one or more forms and the objects placed on the forms.
Answer the following statement true (T) or false (F)
Computer Science & Information Technology