Hey, my code is here: .The issue is, when a user enters 5, it DOES take all desired inputs, but no matter what, when "Run" is entered, it loops "Incorrect Pattern Size, try again.. any help?
I think my problem is with the while loop i made, so i'll show that here:
I think my problem is with the while loop i made, so i'll show that here:
Code
int main()
{
int n, s;
string EndString;
cout << "1. pattern one" << endl;
cout << "2. pattern two" << endl;
cout << "3. pattern three" << endl;
cout << "4. pattern four" << endl;
cout <<"5. Unlimited Entries!" << endl;
cout << "6. quit" << endl;
cout << "enter your choice" << endl;
cin >> n;
if(n == 5){
cout << "Entries will now run forever. When Finished, Type 'Run' to Display" << endl;
do{cout << "enter pattern size";
cin >> s;
if (s >= 2 && s <= 9)
{
switch (n)
{
case 1:
pattern1();
break;
case 2:
pattern2();
break;
case 3:
pattern3();
break;
case 4:
pattern4();
break;
default:
cout << "quit";
}
}
else
cout << "pattern size incorrect try again";
if( n >= 6){
cout << "Terminating Program..." << endl;
return 0;
}
cout << "enter pattern size";
cin >> s;
if (s >= 2 && s <= 9)
{
switch (n)
{
case 1:
pattern1();
break;
case 2:
pattern2();
break;
case 3:
pattern3();
break;
case 4:
pattern4();
break;
default:
cout << "quit";
}
}
else
cout << "pattern size incorrect try again";
}while(EndString != "Run" || "run");}
}


