So what are the conditions that apply when you want to put out that message?
- Smoking seat requested
- Smoking section is full
So it becomes simply:
1 2 3 4 5
constint max_smoking_seats = 5;
if (answer == 1 && currSmokingSeat == max_smoking_seats)
{ cout << " sorry the smoking area is full. Try nonsmoking" << endl;
}
Note that if you include this in your existing if/else logic, you will loop back to the "do you want to make a reservation" question. You probably want to make it a little friendlier and ask "Do you want a non-smoking seat" and then either exit if no, or continue and force answer2 = 2.