I'm a newbie here and came here cause I'm stuck on how to approach something. Here's the info, I'm working on a project to prove that the lottery can't be predicted. The goal is to create a Random Number Generator that will compare it's results with a list of already winning results.
THe system creates a random numbers, num1,num2,num3,num4,num5 and a extra numX
Then it compares with the first numbers in the file with al the winning numbers.
If it's the same it creates another that will be compared to the next winning number.
If it's the same, it continues
if not, it restarts
this goes on until it has completed the hole list of winning numbers.
Then I want it to generate the next random numbers. If my half minded friend at work says, it would be the winning number. I bet him 100$ and it's ON!
So I'm building this project to prove that little turd wrong. lol
SO if someone can help
Right now I have duplicated what this guy did on YouTube
It works and now I'm searching for that reading into file and comparing with the winning numbers file.
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
cout <<"How many sets of numbers would you like to generate?" << endl;
cin >> numberOfSets;
cout << endl;
cout <<"Here are your numbers:" << endl << endl;
for ( k=0; k<numberOfSets; k++)
for(i=0; i<49;i++) balls[i]=i+1;
for(j=0; j<7;j++) megaBall[j]=j+1;
for(i=0; i<5; ++i) ballsOut[i] = balls[i];
megaBallOut = megaBall[i];
sort(ballsOut, ballsOut + sizeof(ballsOut)/sizeof(ballsOut));
for(i=0; i<5; ++i) cout<<setw(5) << ballsOut[i] <<"";
cout<<setw(6) << megaBallOut << endl;