The end of my loop is not working right

Okay i am doing a program for class and when it goes to end the loop the last parts come up. How do i fix this. (program is below)


#include <iostream>
using namespace std;


int main ()
{
int model;
char answer;

cout << "Welcome to Bored Auto Company.\n";
cout << endl;
cout << "I will like to inform out custmors that some car may have a defect. So if you want to check if you car does? (Y/N)";
cin >> answer;
if ((answer =='Y') || (answer == 'y'))
do {
cout << endl;
cout << "Please Enter the model number(0 to exit): ";
cin >> model;
if ((model == 119)||(model == 179)||((189<=model)&&(model<=195))||(model == 221)||(model == 780))
cout << "Your car is defective. Please have it fixed.\n";
else
cout << "Your car is okay.\n";
}while (model !=0);
cout << "Thank you for visiting our site.\n";
return 0;
}

I will take all the help i can get. And thank you.
What I do in situations like this, is
1
2
3
4
5
6
do{//any infinite loop can be here
   ...
   cin >> model;
   if(model == 0) break;
   ...
}while(true);
thank you very much
Topic archived. No new replies allowed.