today = Take[Date[], 3];
title = ToString[today];
(*writetofile = OpenWrite[title, FormatType -> OutputForm];*)

numberB = 80; (*number of students in group B*)

t = OpenRead["ZCA110B_0708.dat"];

For[j = 1, j <= numberB, j++,
  lucky[j] = Read[t, {Number, String}];
  luckynumber[j] = lucky[j][[1]];
  luckyone[j] = lucky[j][[2]];
  ];(*end for j*)
Close["ZCA110B_0708.dat"];
IntegerPart[0.25*numberB];(*default value = 25 percent students*) 
numberluckypeople = 1;
tableluck = Table[luckyone[i], {i, 1, numberB}];
Print["today's date in \!\(\*
StyleBox[\"{\",\n\"MR\"]\)\!\(\*
StyleBox[\"year\",\n\"TI\"]\)\!\(\*
StyleBox[\",\",\n\"MR\"]\) \!\(\*
StyleBox[\"month\",\n\"TI\"]\)\!\(\*
StyleBox[\",\",\n\"MR\"]\) \!\(\*
StyleBox[\"day\",\n\"TI\"]\)\!\(\*
StyleBox[\"}\",\n\"MR\"]\)\!\(\*
StyleBox[\" \",\n\"MR\"]\)\!\(\*
StyleBox[\"is\",\n\"MR\"]\)\!\(\*
StyleBox[\" \",\n\"MR\"]\)", today]; 

(*
Write[writetofile, "today's date in \!\(\*
StyleBox[\"{\",\n\"MR\"]\)\!\(\*
StyleBox[\"year\",\n\"TI\"]\)\!\(\*
StyleBox[\",\",\n\"MR\"]\) \!\(\*
StyleBox[\"month\",\n\"TI\"]\)\!\(\*
StyleBox[\",\",\n\"MR\"]\) \!\(\*
StyleBox[\"day\",\n\"TI\"]\)\!\(\*
StyleBox[\"}\",\n\"MR\"]\)\!\(\*
StyleBox[\" \",\n\"MR\"]\)\!\(\*
StyleBox[\"is\",\n\"MR\"]\)\!\(\*
StyleBox[\" \",\n\"MR\"]\)", today];
*)
(*Write[writetofile, " "];*)
For[dum = 1, dum <= numberluckypeople, dum++,
    ltableluck = Length[tableluck];
    q = Random[Integer, {1, ltableluck}];(*Print["random =", q];*)
    selected = tableluck[[q]];
    Print["the ", dum, "th lucky person is =", selected];
(*
    Write[writetofile, "the ", dum, "th lucky person is =", selected];*)
    tableluck = DeleteCases[tableluck, selected];
    ];
(*Print[" "];*)(* Write[writetofile, " "];*)
(*Print["The lucky one choosen on ", today, " is ",selected];*)
(*Write[writetofile, "The lucky one choosen on ", today, " is ",selected];*)
(*Close[writetofile];*)




