Using \"class\" structure create a program using thefollowing criteria. · There
ID: 3615531 • Letter: U
Question
Using "class" structure create a program using thefollowing criteria.
· There are 50 employees in an organization
· Create a “class” called “employee” to holdthe following employee records
o Employee ID (0 to 49)
o Employee Salary (2500 to 3500)
o Employee Status (F or P)
· classstruct will create a user-defined data-type for employeeinformation
· All the 50 employee’s record should have the same data-typeof “class employee”
o Hint: Create a employee array of type “employee”
· Randomly fill the salary and status values for all employees (usinglooping)
· Ask user to enter a number between 0 to 49, say X
· Print the employee X’s information
Explanation / Answer
Dear... class employee { int EmployeeID; double EmpSalary; char status; } //creating 50 employees employee emp[50]; //inputting employee information for(int i=0;i<50;i++) { cout<<"Enter salary"; cin>>emp[i].EmpSalary; } //to print employees X's information for(int i=0;i<50;i++) { if(emp[i].EmployeeID=='X') cout<<emp[i].EmployeeID<<""<<emp[i].EmpSalary<<""<<emp[i].Status<<endl; } Hope this will help you...Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.