Hi guys im trying to generate 5 random numbers that return a string so i can compare it to a file.
so far i have this but i have no idea how to make it a string. Since i have to compare it to the file i mentioned earlier. This is my assignment and what i have so far.
A lottery ticket buyer purchases 10 tickets a week. always playing the same 10 5-digit "lucky" combinations. Write a program that reads the numbers from an input file, initializes an array with these numbers and then lets the player enter this week's winning 5-digit numbers (Use random number generator to generate 5 numbers in the range 1 through 49 for the winning combinationrather than letting the user enter the winning number combination).
The program should perform both, linear and binary search though the list of the player's numbers and report whether or not one of the tickets is a winner this week. You should present the user with the menu to find out if he/she is a winner through linear or binary search.
Here are the numbers:
11-18-20-24-25
8-10-23-32-36
1-6-12-18-34
23-29-31-32-34
1-15-17-23-32
4-6-13-25-27
8-9-26-29-34
14-17-19-24-30
1-8-25-28-29
13-17-24-29-33
srand((unsigned)time(0));
for(int i=0; i < 5; i++)
{
random_integer = (rand()%49)+1;
cout << random_integer ;
}