Hello
pleas any one helpe me in my code
my code include error
iam convert thise function to over loading(laste function)
but include error
Code:
bool Student::operator!()
{
if(!canRegisterMore())
return true;
else
return false;
}
bool Student::registerCourse(Course course)
//thise function expline abilety of register course but you should
//the 1 can register more is true and 2 add currentcridet and number of cridet<10
{
if (canRegisterMore() &&(currentcredits+ course.getNumberOfCridet())<=10)
{
cout << "You can register course "<<endl;
currentcredits+= course.getNumberOfCridet();
return true;
}
else
{
cout << "Sory you cannot Register course !"<<endl;
return false;
}
}
Student Student::operator+(const Course& courseObj)
{
Student studentObj;
if(!studentObj&&(studentObj.currentcredits+courseObj.getNumberOfCridet()<=10)
{
{
cout << "You can register course "<<endl;
studentObj.currentcredits=currentcredits+courseObj.getNumberOfCridet();
return studentObj;
}
else
cout << "Sory you cannot Register course !"<<endl;
return false;
}
}
I hope helpe me:(