// 22.5HV2 Software Engineering II // Unit 1 Exercise 2 #include #include #include // needed for srand(), rand() and atoi() #include // needed for time() void draw(int[]); void check(int[],int[],int[]); void sort(int[],int); int main(int argc, char *argv[]) { unsigned long n, n_tickets; // unsigned long allows us a large +ve integer int i, ticket[6], balls[6], matches[7]; srand(int(time(NULL))); // seed random number generator with time if ( argc!=2 ) { cerr << "USAGE: ex2 no_of_tickets" << endl; return 1; } // NOTE: You will have to select a LOT of tickets to accurately estimate probabilities (~10000000) n_tickets = atoi(argv[1]); for (i=0;i<7;i++) matches[i] = 0; // initialise matches for (n=0;n