Lottery program using class need help!

First of all, line 43 doesn't work for some reason i have to get it fixed so that numbers need to be in the range of 1-50 where u cannot pick the same numbers, and second of all, this works only for a ticket.However i have to have multiple tickets instead of 1, and i am kind of lost what to do here. Thanks for helping.
P.S: and yes i have to use classes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#include <iostream>
#include <ctime>
#include <cstdlib>
#include <iomanip>
using namespace std;
const int SIZE = 6;
/*defines a class*/
class TexasLottery{
public:
	int lottery[SIZE];								//array for the lottery
	int user[SIZE];									//array for user input
	int match;										//variable to check matching numbers
	int count;										//variable for counting
	void rangomgen();								//rangomgen() function to generate random numbers
	void ticketInput();								//ticketiput function to get the input from user
	void MatchNum();								//matchnum function to check the matching numbers
	void Print();									//display the result
	void GrandPrize();								//display the grand prize
};

/*randomgen function*/
void TexasLottery::rangomgen()
{
	srand((unsigned int)time(0));
for (count = 0; count < SIZE; count++)
{
lottery[count] = 1 + rand() % 50;
}

}
/*ticketinput function*/
void TexasLottery::ticketInput()
{
	cout << "Welcome to Texas Lottery\n";
	cout << "Please enter your 6 numbers for your lottery ticket from 1 to 50: \n" ;
	for (count = 0; count < SIZE; count++)
		cin >> user[count];	
		if(user[count] == 0 || user[count] > 51 || user[count]==user[count])
			cout << "Invalid entry please try again\n";
		for (count = 0; count < SIZE; count++)
		cin >> user[count];	
}
/*matchnum function*/
void TexasLottery::MatchNum()
{
	match = 0;
for(count = 0; count < SIZE; count++)
if(user[count] == lottery[count])
match++;
cout << "Here are the numbers drawn: ";
}
/*print function*/
void TexasLottery::Print()
{
	for(count = 0; count < SIZE; count++)
	cout << lottery[count] << " ";
	cout << "\nYour numbers: ";
}
/*displays granprize*/
void TexasLottery::GrandPrize()
{
	for(count = 0;count < SIZE; count++)
cout << user[count] <<" ";
cout << "\nMatching numbers: " << match << endl;
if(match == SIZE)
cout << "Your are the grand prize winner!!!\n";
}
void main()
{
	TexasLottery tx;												//creates an object
	tx.rangomgen();
	tx.ticketInput();
	tx.MatchNum();
	tx.Print();
	tx.GrandPrize();
}

Welcome to Texas Lottery
Please enter your 6 numbers for your lottery ticket from 1 to 50:
1 2 3 4 5 6
Invalid entry please try again
1 2 33 65 4 3
Here are the numbers drawn: 44 46 31 3 30 48
Your numbers: 1 2 33 65 4 3
Matching numbers: 0
Press any key to continue . . .
Try this function
void TexasLottery::MatchNum()
{
match = 0;
for(count = 0; count < SIZE; count++)
if(user[count] == lottery[count])
match++;
for (int x = 0; x < SIZE; x++)
for(int y = 0; y < SIZE; y++)
{
if((user[x] == lottery[y]) && (x != y))
match++;
}
Topic archived. No new replies allowed.