Im a uni student and currently doing a assignment for a blood doning center, the patients records i have to store in a array and then output the results based on a patients number to retrieve the bolld group and rhesus value.ive only been doing c++ for a couple of weeks and i just need poiting in the right direction. :

start of fuction

void Twotimes(int sub, int time[20])
{ // Start function

int timelimit1,timelimit2,Timecount=0,x,count;
cout<<"For a given day how many blood tests were done between two 2 given times.\n";
cout<<"Enter first time"<<endl;
cin>>timelimit1;
cout<<"Enter second time"<<endl;
cin>>timelimit2;

for (count =0; count <=sub; count ++)
{ // Start for loop
x= time[count];
if ((x>=timelimit1) && (x<= timelimit2))
{ // Start if statement
Timecount = Timecount +1;
} // End if statement

} // End for loop
cout<<Timecount<<endl;
} // End function

void pcodesearch(int sub,char rhesus[20],int pcode[20],char blood_group[20])
{//start function patient code search
int searchpcode;
int count=0;
int pcode_again;
cout<<"For a given day how many blood tests were done between two 2 given times.\n";
cout<<"Enter a patient code\n";
cin >>searchpcode;
do
{
for (count =0; count <=sub; count++){ //for (count =0; count <=sub; count++)
if(searchpcode==pcode[sub])
{
cout<<"Rhesus"<<rhesus[sub]<<"bloodgroup"<<blood_group[sub]<<endl;
} //end if
else
{
cout<<"error\n";
}//end else

} //end for (count =0; count <=sub; count++)
cout<<"Search patient code again?\n";
cin>>pcode_again;
}while (pcode_again!='n');//END OF DO LOOP
} //end of function patient code search




probably bad code !
but i would gratefull if any one can help. cheers
9