Output not calculating correctly for last "else" statement in program

Once again, my C++ program is compiling correctly, but the last else statement is not calculating correctly. For 11 or more registrants, the fee per person is $60. (I'm supposed to calculate 20 registrants for this test case.)

Here's my code:

#include<iostream>

using namespace std;

int main ()
{
int registrants = 0;
double total = 0.0;

cout << "Enter the number of group registrants: ";
cin >> registrants;

if (registrants <= 5)
total = 100 * registrants;

else if (registrants > 5 < 11)
total = 80 * registrants;

else
total = 60 * registrants;

{
cout << "Your total fee for the group is: $" << total << endl;
}
system ("pause");
return 0;
}

Any assistance is appreciated...

THANKS!
Last edited on
else if (registrants > 5 < 11)

is equivalent to: else if ((registrants > 5) < 11)

which isn't what you want as registrants > 5 will always be less than 11.
I have a tendency to OVER-THINK things... Arrrggghhh! Thanks so much for your help! :-)
Topic archived. No new replies allowed.