07-01-2010, 03:06 AM
Instead we can enhance your print function in such a way to use getter function,
void print()
{cout<<"Student Information\n";
cout<<"Name: "<<get_name<<endl;
cout<<"Roll number: "<<get_roll<<endl;
cout<<"Semester: "<<get_semester<<endl;
cout<<"Current GPA: "<<get_cgpa<<endl<<endl;
}
Just a thought,
void print()
{cout<<"Student Information\n";
cout<<"Name: "<<get_name<<endl;
cout<<"Roll number: "<<get_roll<<endl;
cout<<"Semester: "<<get_semester<<endl;
cout<<"Current GPA: "<<get_cgpa<<endl<<endl;
}
Just a thought,
