this is for my son, and I'm not sure how to finish.

The original intent of this program was to make words appear from a letter input ie p equals potty. I have come up with the following code on my own. However my son is autistic so I would love to get some sound involved because he really keys onto it. So instead of it just writing potty to communicate, I would like to play very small pre-recorded sound files.

#include <iostream>


using namespace std;

int main()
{
int i;
for(i=0;i<20;i++)
{
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";



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;
default : cout<< "You hit to many keys or ones I'm not programmed for";
}

}



return 0;
}

///any positive input would be appreciated...........
You Can Check this link for sound
http://www.cplusplus.com/forum/general/8510/

But Just One Question why do you repeat the loop for twenty times ??
I repeated so I could make sure the texts comes out right without restarting the program over and over, I know my solution is newb but it was the only thing I could come up with. I'm learning c++ from two books I bought at the thrift store with this site being the only "instruction" that I've recieved, neither book really tells me what things are for , just that they exist with a bare bones descriptions, so most of the time its like "Ah thats gotta be to do this."


how do I use that, I cut/paste into a file and it gives me a compiler error, could you please add it to original code just once so that it plays a sound, I think I would be able to figure it out from there.
Last edited on
Topic archived. No new replies allowed.