#include<iostream>
using namespace std;
class employee
{
char name [50];
char designation[20];
float basic , gross;
public :
void accept();
void display();
friend void calculated (employee); //friend function declaration
};
void employee ::accept ()
{
cout<<"enter name, designation , basic salary ";
cin>>name>>designation>>basic ;
}
void calculated (employee e )
{
e.gross= e.basic + 0.5* e.basic+ 0.9*e.basic;
cout<<"gross salary is "<<e.gross;
}
display()
{
cout<<"name is "<<e::name<<endl;
cout<<"designation"<<e::designation<<endl;
cout<<"basic salary"<<e::basic<<endl;
}
int main ()
{
employee e ;
e.accept();
e.dipslay();
calculated (a,b);
return 0;
}
I2luY2x1ZGU8aW9zdHJlYW0+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgpjbGFzcyBlbXBsb3llZQp7CgljaGFyIG5hbWUgWzUwXTsKCWNoYXIgZGVzaWduYXRpb25bMjBdOwoJZmxvYXQgYmFzaWMgLCBncm9zczsKCXB1YmxpYyA6Cgl2b2lkIGFjY2VwdCgpOwoJdm9pZCBkaXNwbGF5KCk7CglmcmllbmQgdm9pZCBjYWxjdWxhdGVkIChlbXBsb3llZSk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2ZyaWVuZCBmdW5jdGlvbiBkZWNsYXJhdGlvbiAKCQkKfTsKCnZvaWQgZW1wbG95ZWUgOjphY2NlcHQgKCkKCnsKICBjb3V0PDwiZW50ZXIgbmFtZSwgZGVzaWduYXRpb24gLCBiYXNpYyBzYWxhcnkgIjsKICBjaW4+Pm5hbWU+PmRlc2lnbmF0aW9uPj5iYXNpYyA7Cn0KCnZvaWQgY2FsY3VsYXRlZCAoZW1wbG95ZWUgZSApCgp7CiAgICBlLmdyb3NzPSBlLmJhc2ljICsJMC41KiBlLmJhc2ljKyAwLjkqZS5iYXNpYzsKICAgIAogICAgY291dDw8Imdyb3NzIHNhbGFyeSBpcyAiPDxlLmdyb3NzOwoJCn0KCgpkaXNwbGF5KCkKewoJY291dDw8Im5hbWUgaXMgIjw8ZTo6bmFtZTw8ZW5kbDsKCWNvdXQ8PCJkZXNpZ25hdGlvbiI8PGU6OmRlc2lnbmF0aW9uPDxlbmRsOwoJY291dDw8ImJhc2ljIHNhbGFyeSI8PGU6OmJhc2ljPDxlbmRsOwp9CgppbnQgbWFpbiAoKQp7CgllbXBsb3llZSBlIDsKCWUuYWNjZXB0KCk7CgllLmRpcHNsYXkoKTsKICAgIGNhbGN1bGF0ZWQgKGEsYik7CglyZXR1cm4gMDsgCn0K