i dont know wht is wrong with my view function no error showing but when i m going to the view function option it does not show my detail but it goes to the main menu ..!!
void viewmoduledetail(int ID){
system("cls");
bool found=true;
int i,j;
readModuleDetailsfile();
cout<<"\n\t\--------STUDENT MANAGEMENT SYSTEM------------";
cout<<"\n\t\-----------------------VIEW MODULE DETAILS----------------------------";
j= moduleF.size();
for(i=0;i <j;i++)
{
if(moduleF[i].getstudentID()==ID)
{
found=true;
cout<<"\n\n Degree ID : "<<moduleF[i].getModuleID();
cout<<"\nModule 1 : "<<moduleF[i].getMname1();
cout<<"\nExam Marks : "<<moduleF[i].getmarks1();
cout<<"\nAssignment marks : "<<moduleF[i].getass1();
cout<<"\n\Module 2 : "<<moduleF[i].getMname2();
cout<<"\nExam Marks : "<<moduleF[i].getmarks2();
cout<<"\nAssignment Marks : "<<moduleF[i].getass2();
cout<<"\nModule 3 : "<<moduleF[i].getMname3();
cout<<"\nExam Marks : "<<moduleF[i].getmarks3();
cout<<"\nAssignment Marks : "<<moduleF[i].getass3();
cout<<"\nHome Availability : ";
if(moduleF[i].getAvailability()==true)
cout<<"True"<<endl;
else
cout<<"False"<<endl;
cout<<"\n********************************************************\n";
system("pause");
}
}
if(found==false)
cout<<"\n\nWARNING: Module Details cannot be found"<<endl;
}
void viewmoduledetail(int ID)
{
system("cls");
bool found=true;
int i,j;
readModuleDetailsfile();
cout<<"\n\t\--------STUDENT MANAGEMENT SYSTEM------------";
cout<<"\n\t\-----------------------VIEW MODULE DETAILS----------------------------";
j = moduleF.size();
for(i=0; i<j; i++)
{
if(moduleF[i].getstudentID()==ID)
{
found = true;
cout<<"\n\n Degree ID : "<<moduleF[i].getModuleID();
cout<<"\nModule 1 : "<<moduleF[i].getMname1();
cout<<"\nExam Marks : "<<moduleF[i].getmarks1();
cout<<"\nAssignment marks : "<<moduleF[i].getass1();
cout<<"\n\Module 2 : "<<moduleF[i].getMname2();
cout<<"\nExam Marks : "<<moduleF[i].getmarks2();
cout<<"\nAssignment Marks : "<<moduleF[i].getass2();
cout<<"\nModule 3 : "<<moduleF[i].getMname3();
cout<<"\nExam Marks : "<<moduleF[i].getmarks3();
cout<<"\nAssignment Marks : "<<moduleF[i].getass3();
cout<<"\nHome Availability : ";
if(moduleF[i].getAvailability()==true)
cout<<"True"<<endl;
else
cout<<"False"<<endl;
cout<<"\n********************************************************\n";
system("pause");
}
}
if(found==false)
cout<<"\n\nWARNING: Module Details cannot be found"<<endl;
}
This is very horribly written code. But at least now it can be read.
What exactly is your code supposed to do? You only gave us the details of one method.
It should be obvious, but nothing in this code is going to tell you or us why it doesn't work.
We need to see the code in the "getstudentID()" method.
And it would probably help to see the design of "moduleF[i]" as well.