예제 #1
0
// gives the instructions about adding a scientist
void Information::addScientist()
{
    Service serv;
    cout << "Enter information about the computer scientist whom you wish to add" << endl;
    cout << "If he/she is still alive put in '0' in 'Year of death'" << endl;
    cout << "In gender, enter 'M' for male or 'F' for female"<< endl;
    
    string name, gender, yod, yob;
    const string alive = "0";

    cout << "Name: ";
    cin.ignore();
    getline(cin,name);

    cout << "Year of birth: ";
    cin >> yob;
    
    cout << "Year of death: ";
    cin >> yod;
 
    cout << "Gender: ";
    cin >> gender;
        if(gender == "m")
            gender = "M";
        else if(gender == "f")
            gender = "F";
        
    serv.addScientist(name, yob, yod, gender);
}
예제 #2
0
// gives the instructions about adding a scientist
void Information::addScientist(vector<Scientist>& vec){
    Service serv;
    cout << "Enter information about the computer scientist whom you wish to add" << endl;
    cout << "If he/she is still alive put in '0' in 'Year of death'" << endl;
    cout << "In gender, enter 'M' for male or 'F' for female"<< endl;

    serv.addScientist(vec);
}