This assignment is to create a program to compute factorials using threads and signals as event triggers. What follows is a fairly thorough description of what different pieces of your code should contain and precisely how signals, threads, and globals should interact. You'll need to include quite a few headers that I discussed in class and reiterated (in part) here. MAIN: The "int main" function of your program should have only about seven lines and no other code. The first function call is to seed the random number generator (use srand(time(NULL)) which requires stdlib.h and time.h). The second call is to set up a signal handler for SIGINT (or control-c on the keyboard), and the third is to set up a signal handler for SIGQUIT (or control-\ on the keyboard). Next is a call to pause() (in unistd.h) inside of a loop that continues until SIGQUIT has been performed. Lastly you'll report values computed - but this will make more sense after you read what should be handled by SIGINT and SIGQUIT. seed the random number generator: srand( time(NULL) ); assign signal handler for SIGINT assign signal handler for SIGQUIT while(have not seen SIGQUIT) pause(); report all values computed SIGINT and Thread Creation For SIGINT: Have your signal handler first create a random number between 0 and 13. (To get a random number between 0 and 13 you can use rand()%14). Then, the signal handler should create a worker thread and pass the number as a character string parameter to the function (not via a global). A note below will help you convert the integer into a character string so that you may properly pass it to the function. The handler should then wait for the worker thread to finish completion before returning control back to the main program. Thread operation: The worker thread should compute the value of the factorial passed to it (use atoi to convert the char string BACK). The result of this computation should be stored globally and permanently by the worker thread (the random number could be stored in one vector while the factorial results could be stored in another vector). SIGQUIT: For SIGQUIT: Have your signal handler report the fact that sigquit has been seen via a global variable. This is how we will exit the loop in main containing pause(). Side Note: To convert an integer to a string, you can use sprintf. int value = 77; // the integer variable that I want to convert to a cstring char buf[32]; // a buffer to be the cstring sprintf(buf,"%d",value); //place the value as a string into the buf Of course, to convert a string back into an integer use: //assume param is a char * to convert to an integer int value = atoi(param); //if you assume param is a void * that was passed a char *, you can use; int value = atoi ( (char *) param );