Creating a system in C++ using records to enter the data of 10 employees with their numbers and salaries With the possibility of choosing the user It shows the user explanatory messages for the selection Data entry function for employees in records Function of printing employee data from records Function to search for an employee within the records A function to find the largest value in a record A function to arrange employees according to the largest salary
#include<iostream> #include<cstring> using namespace std; //structure to store employee data struct Employee { int id; char name[50]; int age; long salary; }; //function to get employee data from user Employee getEmployee() { Employee emp; cout<<"Enter Employee id: "; cin>>emp.id; cout<<"Enter Employee Name: "; cin.ignore(); cin.getline(emp.name, 50); cout<<"Enter Employee Age: "; cin>>emp.age; cout<<"Enter Employee Salary: "; cin>>emp.salary; cout<<endl; return emp; } //function to print employee data void printEmployee(Employee emp) { cout<<"Id: "<<emp.id<<endl; cout<<"Name: "<<emp.name<<endl; cout<<"