Dear Sir,
After finishing the 1st part, I still have many problem of the question.
Program Student_millionaire;
{$APPTYPE CONSOLE}
{
}
uses
SysUtils, OurCrt;
Var User_Choice:Integer;
Procedure ContestantsList;
Begin
WriteLn('1 pressed,listing all the contestants...');
ReadLn;
End;
Procedure Generate10finalists;
Begin
WriteLn('2 pressed,generating the 10 finalist''s numbers...');
ReadLn;
End;
Procedure UpdateFinalists;
Begin
WriteLn('3 pressed,finding and listing the finalists...');
ReadLn;
End;
Procedure ChangeDetails;
Begin
WriteLn('4 pressed,changing the phone a friend details...');
ReadLn;
End;
Procedure EnrolContestant;
Begin
WriteLn('5 pressed,enroling a new contestant...');
ReadLn;
End;
Procedure GetOutOfHere;
Begin
WriteLn('6 pressed,exiting...');
Sleep(1000);
End;
Begin
User_Choice:=0;
While User_Choice <> 6 Do Begin
ClrScr;
WriteLn('Please enter an integer in the range 1...6');
WriteLn;
WriteLn(' 1 List all the contestants');
WriteLn(' 2 Generate the 10 finalist''s numbers');
WriteLn(' 3 Find and list the finalists');
WriteLn(' 4 Change the phone a friend details');
WriteLn(' 5 Enrol a new contestant');
WriteLn(' 6 Exit');
WriteLn;
ReadLn(User_Choice);
Case (User_Choice) of
1:ContestantsList;
2:Generate10finalists;
3:UpdateFinalists;
4:ChangeDetails;
5:EnrolContestant;
6:GetOutOfHere;
Else
Begin
WriteLn('Wrong Number..');
WriteLn('Exiting...');
End;
End;
End;
End.
The 2nd part is to generate the 10 finalist's numbers. Randomly generate 10 numbers, these numbers must range from 1 to the number of people in the file. I cannot have duplicate numbers being drawn.
Cheers,