Name three categories of errors that may be found in a computer program. Which category is detected by the compiler?


// 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;
}


Three kinds of errors: syntax, run-time, logic. The compiler detects syntax errors.

Computer Science & Information Technology

You might also like to view...

An exception:

a. Terminates program execution. b. Terminates the block where the exception occurred. c. Will terminate the block where the exception occurred unless a catch command stops it. d. Will not terminate a block unless explicitly instructed to do so.

Computer Science & Information Technology

In OpenOffice Impress, the feature that assists in the creation of new presentations is called the Presentation ________

Fill in the blank(s) with correct word

Computer Science & Information Technology

Google+ is an example of a(n) ________ network

Fill in the blank(s) with correct word

Computer Science & Information Technology

A _____ is a collaborative Web site that allows users to create and edit Web page content freely using any Web browser.

a. cache b. wiki c. cookie d. domain

Computer Science & Information Technology