Create a class called employee with member data empno, name, deptname, designation, age, and salary. Perform the following by including member functions in the class: a) To accept the details of 5 employees( Array of object) b) To display the details of employees. c) To search for an employee in the array of objects created, by means of empno and display his details d) To find the youngest employee among all the employees and display the details of that employee e) To find the total salary of all employees.
OOPs
In today's technology-driven world, computer programming skills are in high demand. The object-oriented programming (OOP) approach is very much useful while designing and maintaining software programs. Object-oriented programming (OOP) is a basic programming paradigm that almost every developer has used at some stage in their career.
Constructor
The easiest way to think of a constructor in object-oriented programming (OOP) languages is:
Create a class called employee with member data empno, name, deptname, designation, age, and salary. Perform the following by including member functions in the class:
a) To accept the details of 5 employees( Array of object)
b) To display the details of employees.
c) To search for an employee in the array of objects created, by means of empno and display his details
d) To find the youngest employee among all the employees and display the details of that employee
e) To find the total salary of all employees.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 3 images