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...

The IOCS is concerned with __________ I/O, while the file system is more concerned with __________ I/O.

a. physical/logical b. logical/physical c. high speed/slow d. character/block

Computer Science & Information Technology

Which of the following is not true about a Word cover page?

A) Word automatically assigns it a page number of one. B) It provides introductory information. C) Cover pages can contain content controls which allow a user to enter information. D) Word contains a gallery of predefined cover pages.

Computer Science & Information Technology

The ____________________ property sets the minimum width of an element.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

You can name a database only after you have created it

Indicate whether the statement is true or false

Computer Science & Information Technology