In: Computer Science
An IT organization decides to collect details of an employee and process the details to decide on whether the employee :
• Employee has any meritorious achievement
• Is he eligible for promotion
• Does he need additional technical training support for performing tasks assigned
The following details need to be collected, namely his name, contact details, skills and qualification, service, awards, etc
• The employee would be often incentives if he has received awards for any IT skill and has completed 6 years service
• The employee would be offered promotion if he has contributed to improve business by way of designing new software and patented the same
Here we are given the details we need collect from the employees and then we need to decide :
1. If the employee is eligible for incentives or not.
2. If the employee is eligible for promotion or not.
For this let us write a program in c++ to collect details and decide upon the above two points.
Below is the code snippet of the required program.
#include<iostream>
using namespace std;
#include<string>
//lets first create the structure which will contain the details of the employees separately
struct employee
{
string Employee_name; //variable to contain employee name
string contact_number; //variable to contain employee contact number
char Awards; //variable to contain employee has received any award for IT skill or not
int Service_year; //variable to contain employee service years
char Software_designed_patented; //variable to contain employee has designed and patented new software or not
};
//end of the structure
// main() driver function starts here
int main()
{
cout<<"Enter the number of employees :"<<endl; //prompt to enter the number of employee
int emp;
cin>>emp;
//start of for loop
for(int i=0;i<emp;i++)
{
struct employee Employee_1;
cout<<"Enter employee "<<i+1<<" Name : "; //prompt to enter the name of the employee
cin>>Employee_1.Employee_name;
cout<<endl;
cout<<"Enter employee "<<i+1<<" Contact Number : "; //prompt to enter the employee contact details
cin>>Employee_1.contact_number;
cout<<endl;
cout<<"Has the employee "<<i+1<<" received any award for IT skill(Y/N) : "; //prompt to enter if the employee has received any award for it skills or not
cin>>Employee_1.Awards;
cout<<endl;
cout<<"Enter employee "<<i+1<<" Service year : "; //prompt to enter the number of service years of the employee
cin>>Employee_1.Service_year;
cout<<endl;
cout<<"Has the employee "<<i+1<<" designed and patented any new software(Y/N) : "; //prompt to enter if the employee has designed and patented new software or not
cin>>Employee_1.Software_designed_patented;
cout<<endl;
cout<<"According to the details provided the employee"<<i+1<<endl; // prompt for output
if(Employee_1.Awards=='Y' && Employee_1.Service_year>=6)//Checking for the conditions to receive incentives
cout<<"1. Is eligible for incentives and"<<endl;
else
cout<<"1. Is not eligible for incentives and"<<endl;
if(Employee_1.Software_designed_patented=='Y') //Checking for the conditions to get promoted.
cout<<"2. Is eligible for promotion"<<endl;
else
cout<<"2. Is not eligible for promotions"<<endl;
cout<<endl;
//printed the result for the given employee
}
//end of for loop
}
//end of the driver function
please refer to the below code snapshots for help :
below is the OUTPUT :