Thanks for your help.
here is the code
Expand|Select|Wrap|Line Numbers
- #include <iostream>
- using namespace std;
- char intro(char ans);
- //Requires: The user must input one of the following a char values:
- //q,Q,m,M,i,I.
- //Promises: Returns the input to main.
- int main()
- {
- char ans= intro(char ans);
- do
- {
- switch (ans)
- {
- case 'q':
- case 'Q':
- cout<<"Q"<<endl;
- break;
- case 'm':
- case 'M':
- cout<<"M"<<endl;
- break;
- case 'i':
- case 'I':
- cout<<"I"<<endl;
- break;
- default:cout<<"improper data"<<endl;
- //intro runs good data.
- }
- }while (ans!=="q"||ans!=="Q"||ans!=="m"||ans!=="M"||ans!=="i"||ans!=="I");
- }
- char intro(char ans)
- {
- cout<<"What the program does, and select one of the 3 options (m,i,q)"<<endl;
- cin>> ans;
- return ans;
- }