Answer:
class student {
private:
int studentID;
string student_name;
public:
int getID() // accessor...
{
return studentID;
}
string getname() //accessor...
{
return student_name;
}
void setvalues(int ID,string name) //mutator..
{
studentID=ID;
student_name=name;
}
};
Explanation:
The above written class is in C++.I have created two private members student_ID and student_name.Two accessor function getname and getID and one mutator function setvalues and these functions are public.