#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
char anotherNum='y';
char quit='y';
int entries=1; //number of people on list
string userName[100];
do
{
cout << "Username: ";
cin >> userName[entries];
entries++;
cout << "Would you like to add another? ";
cin >> quit;
}
while ((quit == 'y') || (quit == 'Y'));
do
{
for(int i=1; i < entries; i++)
{
cout << i << ":" << userName[i] << endl;
}
int luckyNum= (rand() % entries);
cout << "There are " << entries-1 << " entries on the list." << endl;
cout << "The lucky number was " << luckyNum << endl;
cout << userName[luckyNum] << " is the winner!" << endl;
cout << "Would you like to pick another number? ";
cin >> anotherNum;
}
while ((anotherNum == 'y') || (anotherNum =='Y'));
return 0;
}