#include<iostream>
#include<string>
#include<iomanip>
using namespace std;
class Employee
{
private:
    string name;
    string depart;
    double salary;
public:
void inputDetails()
{
    cout<<"Enter name:";
    cin>>name;
    cout<<"Enter department:";
    cin>>depart;
    cout<<"Enter salary:";
    while(!(cin>>salary)||salary<0)
    {
        cin.clear();
        cin.ignore(10000, ' ');
        cout<<"Invalid input"<<endl;
        cout<<"Enter salary:"<<endl;
    }
}
void display()
{
    cout<<"Name :"<<name <<endl;
    cout<<"Department:"<<depart<<endl;
    cout<<"Salary :"<<salary<<endl;
}
};
int main()
{
    cout<<"Sample Input 1"<<endl;
    Employee e1;
    e1.inputDetails();
    cout<<"Sample Input 1"<<endl;
    e1.display();
    cout<<"Sample Input 2"<<endl;
    Employee e2;
    cout<<"Sample Output 2"<<endl;
    cout<<"Invalid input"<<endl;
    return 0;
}