I am trying to make a program for class which is circular so it can be used until the user is done. the idea is choose an option then it calls the function, but for some reason it calls the estimate screen even when main_input does not equal 2. I know this is a newbie question, I'm still very much learning. Can someone help?
void Main_Screen::main_screen()
{
cout<< "MAIN SCREEN" <<endl;
cout<< "Enter the number to the left of your option." <<endl;
cout<< "1) Customer Information" <<endl;
cout<< "2) Estimate Calculation" <<endl;
cout<< "0) Close Cleaner" <<endl;
}
void Estimate::estimate_screen()
{
while (estimate_input != 0)
{
cout<< "ESTIMATE CREATION" <<endl;
cout<< "What would you like to do?" <<endl;
cout<< "1)Create an estimate" <<endl;
cout<< "2)Change variables" <<endl;
cout<< "0)Leave estimate creation" <<endl;
cin>> estimate_input;
}
}
int main()
{
int main_input = 4;
Intro a1;
Main_Screen a2;
Estimate a3;
a1.main_print();
while (main_input > 0)
{
a2.main_screen();
cin>> main_input;
if (main_input = 2) a3.Estimate::estimate_screen();
}
}