iso a little help

I want the following to continue running till I select "quit"

later on I'll add sound, It's to help my autistic son communicate better.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include <iostream>


using namespace std;

int main()
{

     {
    char letter;
    cout<<"Zach show me:\n";
    cout<<"Your choices are:  \n";
    cout<<"P for Potty\n";
    cout<<"B for Break\n";
    cout<<"E for Eat\n";
    cout<<"D for Drink\n";
    cout<<"M for Mom\n";
    cout<<"C for Call\n";
    cout<<"Q for Quit\n";



    cin>>letter;



    switch(letter)
    {
        case 'p': cout<< "You need to go Potty?";break;
        case 'b': cout<< "You need a break?"; break;
        case 'e': cout<< "You need to Eat?"; break;
        case 'd': cout<< "You need a Drink?"; break;
        case 'm': cout<< "You need Mom?"; break;
        case 'c': cout<< "You need to call"; break;
        case 'q': cout<< "You want quit"; break;
        default : cout<< "You hit to many keys or ones I'm not programmed for";


    }

     }



    return 0;
}

basically when complete this program will print his want/need and via wave file repeat the sound , but for now I just want it to keep repeating the program till I select quit.
Last edited on
Please use code tags!

EDIT: you would want to encase the first cout statement all the way to the end of the case statements with a while statement like so:

1
2
3
4
    char letter;
    do{
            //code here
    }while(letter!='q');
Last edited on
Topic archived. No new replies allowed.