In this program I' trying to combine comparisons, below I have given the layout of the program I am trying to build. Also I have included what I come up with so far. From what I have so far I can build the program but I cannot figure out have to stop it from cout'ing. So if someone can help me get it to stop looping, it will be highly appreciated.
Combining Comparisons
There is a secret government organization called PIB which only accepts recruits who fit
their criteria (shown below). If you fit any of the combinations of criteria, then you can
apply to work for PIB. Write a program which asks the user appropriate questions (ask
all the questions up front) and then determines if the candidate is acceptable. Use the
screen shots as a guide.
Here are the rules:
• If you are male between the ages of 18 and 30 (inclusive) you may apply.
• If you are female between the ages of 18 and 32 (inclusive) you may apply.
• If you are male between the ages of 18 and 35 (inclusive) and either were in the
military or you can do at least 50 pushups in a row you may apply.
• If you are female between the ages of 18 and 40 (inclusive) and either were in the
military or you can do at least 30 pushups in a row you may apply.
• No one else is eligible.
*/
cpp
#include <iostream>
#include <string>
using namespace std;
int main()
{
string fullname, military, yes, no;
cout <<"What is your full name? " <<endl;
getline (cin, fullname);
int age, pushups;
cout << "How old are you? " <<endl;
cin >> age;
cout << "Were you ever in the military (yes/no)?" << endl;
cin >> military;
cout << "How many pushups can you do in a row?" << endl;
cin >> pushups;
char m, f;
cout << "Are (m)ale or (f)emale?" << endl;
cin >> m, f;
while (m == m)
{
if ((age >= 18) && (age <=30))
cout << "Yes, "<< fullname << ", you may apply." << endl;
if ((age >= 18 && age <=35) && (military == yes))
cout << "Yes, "<< fullname << ", you may apply." << endl;
if ((age >= 18 && age <=35) && (pushups >=50))
cout << "Yes, "<< fullname << ", you may apply." << endl;
else
cout << "Sorry, "<< fullname << ", you are not eligible." << endl;
break;
}
while (f == f)
{
if ((age >= 18) && (age <=32))
cout << "Yes, "<< fullname << ", you may apply." << endl;
if ((age >= 18 && age <=40) && (military == yes))
cout << "Yes, "<< fullname << ", you may apply." << endl;
if ((age >= 18 && age <=40) && (pushups >=30))
cout << "Yes, "<< fullname << ", you may apply." << endl;
else
cout << "Sorry, "<< fullname << ", you are not eligible." << endl;
break;
}
}
*** MOD EDIT: Added code tags. Please

***