Based on the figure below, I wrote my code.

This is the code I wrote:
#include<iostream>
#include<string>
using namespace std;
class person
{
private:
    int code;
    string name;
public:
    void    setCode(int c) { code=c; }
    int getCode()          { return code; }
    void setName(string s) { name=s; }
    string getName()       { return name; }
};
class account : public person
{
private:
    double pay;
public:
    void    setPay(double p) { pay=p; }
    double getPay()          { return pay; }
};
class admin : public person
{
private:
    string experience;
public:
    void setExper(string e) { experience=e; }
    string getExper()       { return experience; }
};
class master : public account, public admin
{
};
int main()
{
    master mastObj;// create master object.
    mastObj.setName("John");
    system("pause");//to pause console screen, remove it if u r in linux
    return 0;
}
The compiler showed these errors:
Error   1   error C2385: ambiguous access of 'setName'
Error   2   error C3861: 'setName': identifier not found    
Error   3   IntelliSense: "master::setName" is ambiguous
 
     
     
     
    