Thursday, July 1, 2010

main()
{
    int midterm, final, bribe;
    double grade;
    cout << "please enter midterm, final and bribe: ";
    cin >> midterm >> final >> bribe;

   
    if  ( bribe > 50 )
    {
        grade = 100;
        cout << "Thanks!" << endl;
    }
    else
    {
        grade = (midterm + final)/2.0;
        cout << "Here is your grade: ";
    }
    cout << grade << endl;
}   

No comments:

Post a Comment