Code:
#include <iostream.h>
#include <stdlib.h>
#include <windows.h>
void soundSequence(int sounds[], int duration [], int numSounds);
int main(int argc, char *argv[])
{
//Convert the following code into a function with prototype:
//void soundSequence(int sounds[], int duration [], int numSounds);
//main is to read command line arguments and load up arrays to
//pass to function. Allocate memory dynamically for arrays.
//command line: prog sound1 duration1 sound2 duration2.....
//sound of 0 will sleep for the duration.
Beep(1000,1000);//1kHz tone for 1 second
Sleep(1000);//Wait for 1 second!!
Beep (2000,1000);//2kHz tone for 1 seconds
Beep (4000,2000);//4kHz tone for 2 seconds
Beep (6000,4000);//6 kHz tone for 4 seconds
system("PAUSE");
return 0;
}
I hope this is better