i am trying to error trap this so the user can only choose odd numbers 3-9 as the width and height of shape. i am also trying to loop this so it will continue until the user chooses to quit. using y for yes to continue or n for no to quit.
Code:
  
#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
int number =0, answer,h=0,width=0, setw=0;
char symbol = '\0';
cout << "Please choose a letter that corresponds to the shape of your choosing \n";
cout << " A. triangle " << endl;
cout << " B. upside down triangle " << endl;
cout << " C. rectangle " << endl;
cout << " D. plus sign " << endl;
cout << " E. quit " << endl;
cin >> symbol;
cout << " Please choose an odd number 3-9 to calculate width and height of your choosing\n";
cin >> number;
 
do 
{
do 
{
switch (symbol)
{
case 'a':
case 'A':
cout << " Thank you, you have choosen triangle and " << number << " for height and width" << endl;
cout << " Please enter a symbol to design your shape. " << endl;
cin >> symbol;
cout << '\n';
for(int i=0; i<number; i++)
{
for(int y=-1; y<i; y++)
cout << symbol;
cout << "\n";
}
cout << '\n' << " Do you wish to continue: (y/n) " << endl;
cin >> answer;
break;

break;
default:
cout << " please enter a valid response. press y for yes and n for no " << endl;
}
}while (( number==3) || ( number==5) || (number==7) || ( number==9));

}while (( answer!= 'n') ||(answer != 'N'));
{
cout << " thank you for your time " << endl;
}
return 0;
}