Chapter 5 practice program 2 difficulties
:confused:
I've been working through the e-book fine, until this program. I can make the menu work fine, as long as you choose an item. Anything off the list won't re-print the menu. It must be a syntax error, yes I'm old school syntax error, which I can't see.
Any help would be appreciated,
Dave H.
Code:
# include<iostream>
using namespace std;
int main()
{
int a = 0 ;
{
cout<<"\n\n\n";
cout<<"\t Please choose 1 item.\n\n";
cout<<"\t 1 : one\n\n";
cout<<"\t 2 : two\n\n";
cout<<"\t 3 : three\n";
cout<<"\t -------------\n";
cout<<"\t Choice : ";
cin>>a;
} while (a ==1 && a == 2 && a ==3) ;
{
if (a == 1)
{
cout<<"\a\n";
return 0;
}
else if (a == 2)
{
cout<<"\a\a\n";
return 0;
}
else if (a == 3)
{
cout<<"\a\a\a\n";
return 0;
}
}
}