The program doesn't run. :(

#include <cstdlib>
#include <iostream>

using namespace std;
int main (int argc, char *argv [])
{
int Prelim;
int Midterm;
int Semifinals;
int Finals;
int Sum;
int Average;

cout << "The Prelim is " ;
cin >> Prelim;
cout << "The Midterm is " ;
cin >> Midterm;
cout << "The Semifinals is " ;
cin >> Semifinals;
cout << "The Finals is " ;
cin >> Finals;

Average = (Prelim + Midterm + Semifinals + Finasls)/4 ;
cout << Average;

/*cout << "The Sum is " ;
cout << Prelim + Midterm + Semifinals + Finals;
cout << "The Average is " ;
cout << (Prelim + Midterm + Semifinals + Finals)/4;
*/

if (Average >= 99-100);
cout << "1.00" <<endl;
else if
(Average >94-97);
cout << "1.25" <<endl;
else if
(Average >90-93);
cout << "1.50" <<endl;
else if
(Average >88-89);
cout << "1.75" <<endl;
else if
(Average >85-87);
cout << "2.00" <<endl;
else if
(Average >83-84);
cout << "2.25" <<endl;
else if
(Average >80-82);
cout << "2.50" <<endl;
else if
(Average >78-79);
cout << "2.75" <<endl;
else if
(Average >75-77);
cout << "3.00" <<endl;
else if
(Average >70-74);
cout << "4.00" <<endl;
else if
(Average >70);
cout << "5.00" <<endl;
else if
(Average >Incomplete);
cout << "INC" <<endl;

return O;
}
Please use code tags. http://www.cplusplus.com/articles/jEywvCM9/
You can edit your post, highlight your code and click the <> button on the right.

 
Average = (Prelim + Midterm + Semifinals + Finasls)/4 ;

Integer division will truncate the fractional part.

1
2
if (Average >= 99-100);
cout << "1.00" <<endl;
Topic archived. No new replies allowed.