assignment2.c
//Option 4: Compare user entered numbers with winning lotto numbers

Option 4: Compare user entered numbers with winning lotto numbers
Option 4 : Compare user entered numbers with winning lotto numbers
void compare_lotto_nums(int *user_numbers)
{
	int i = 0;
	int match_num = 0;
	int bonus_num = 0;
	for (i=0; i<NUMUSER; i++)
	{
		if(*(user_numbers+i) == 1)
		{
			match_num++;
		}
		if(*(user_numbers+i) == 3)
		{
			match_num++;
		}
		if(*(user_numbers+i) == 5)
		{
			match_num++;
		}
		if(*(user_numbers+i) == 7)
		{
			match_num++;
		}
		if(*(user_numbers+i) == 9)
		{
			match_num++;
		}
		if(*(user_numbers+i) == 11)
		{
			match_num++;
		}
		if(*(user_numbers+i) == 42)
		{
			bonus_num++;
		}
	}
	printf("You have %d winning numbers\n",match_num);
	if(bonus_num == 1)
	{
		printf("You have 1 bonus number\n");
	}
	if(match_num == 6)
	{
		printf("You have won the Jackpot congratulations\n");
	}
	else if (match_num == 5 && bonus_num == 1)
	{
		printf("You have won a New Car congratulations\n");
	}
	else if (match_num == 5)
	{
		printf("You have won a Holiday congratulations\n");
	}
	else if (match_num == 4 && bonus_num == 1)
	{
		printf("You have won a Weekend Away congratulations\n");
	}
	else if (match_num == 4)
	{
		printf("You have won a Night Out congratulations\n");
	}
	else if (match_num == 3 && bonus_num == 1)
	{
		printf("You have won a Cinema Ticket congratulations\n");
	}
}
void compare_lotto_nums ( int * user_numbers ) { int i = 0 ; int match_num = 0 ; int bonus_num = 0 ; for ( i = 0 ; i < NUMUSER ; i ++ ) { if ( * ( user_numbers + i ) == 1 ) { match_num ++ ; } if ( * ( user_numbers + i ) == 3 ) { match_num ++ ; } if ( * ( user_numbers + i ) == 5 ) { match_num ++ ; } if ( * ( user_numbers + i ) == 7 ) { match_num ++ ; } if ( * ( user_numbers + i ) == 9 ) { match_num ++ ; } if ( * ( user_numbers + i ) == 11 ) { match_num ++ ; } if ( * ( user_numbers + i ) == 42 ) { bonus_num ++ ; } } printf ( " \n " , match_num ) ; if ( bonus_num == 1 ) { printf ( " \n " ) ; } if ( match_num == 6 ) { printf ( " \n " ) ; } else if ( match_num == 5 && bonus_num == 1 ) { printf ( " \n " ) ; } else if ( match_num == 5 ) { printf ( " \n " ) ; } else if ( match_num == 4 && bonus_num == 1 ) { printf ( " \n " ) ; } else if ( match_num == 4 ) { printf ( " \n " ) ; } else if ( match_num == 3 && bonus_num == 1 ) { printf ( " \n " ) ; } }
Option 4: Compare user entered numbers with winning lotto numbers
Option 4 : Compare user entered numbers with winning lotto numbers
//Compares each element to winning numbers to see if you get a match and increments counter
 //End if
 //End for
 //If bonus number is incremented print that user has got a bonus number
 //If match number is incremented and/or bonus number then show user what they have won
