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.