Question
Display all employee information in an appropriate manner
Answer :
Word Count : 1309
_______ ________ ____ __________ ____ _______ ___ _________.
________ ___ __________ ________ ______ ________ _____.
_______ _____ ______ ________ _____ ____ ________.
__________ _________ ___ _______ ___ ___ _______ _________ ________ ______.
______ _____ ________ _________ _____ _____ ___ _____ ________.
__________ _____ ___ ____ _______ ___ ______ _________ __________.
_____ ______ ____ _______ _______ ______ __________ _____ _____ __________ _______.
______ ______ ___ ________ ___ _______.
________ _______ ____ ___ ___ ______ _________ _________ __________ _______ _______.
_________ ________ ___ ______ ___ ______.
___ ____ ____ ____ ___ ____ _______ _____ ________ ________ ________ ________.
___ _______ _________ ______ ___ ____ ________.
_________ _____ _____ _________ ______ ______ _________ ________ __________ _____.
___ ______ __________ ______ ________.
______ __________ _________ ______ ______ ____ ______ ___ ______ ____ _____ ______.
_______ __________ ___ ___ ____ _______ ______ _______.
_______ ______ ______ _______ ___ _________.
______ ____ _________ _______ ____ _________.
____ ___ ______ ____ ______ ________ _______ _________ _______ ___.
______ _________ __________ ___ _________ ______ ___.
___ _______ ______ _______ __________ ________.
__________ ________ _____ ______ ___ _________ _________.
________ ___ _____ _________ _________.
_____ _______ _______ ___ ____ ___ ________.
__________ _______ ______ ______ _________ ________ __________ _____ ___ ______.
_______ _______ ______ ________ ____ ________ ____ _________ _____.
______ _____ ______ _________ _____ ____ __________ _______ __________ ___ ____.
________ ____ ______ ___ ___ ________ ___ _____ ______ ________.
_________ ____ ______ ___ ________ __________ ________ ___ _________.
_____ ____ ________ ______ _____ _________ __________ _____.
_____ __________ ________ ______ ___ ________ ________ _____ ____ ___.
____ ____ _____ _______ ______ ____ ____ _______.
________ _______ _______ __________ ___ ________ ___ ___ ________ ______ _______.
_______ ____ ______ _________ _______ __________ ___ ___ ________ _____ _____ ______.
______ _________ ____ ______ ________.
________ ________ _________ ___ ____ ___ ______ ______ ________ _________.
_______ _________ _______ ___ _________.
_____ ____ ______ _____ __________ ______ ____ _____ ________ ____ ________ _________.
___ ____ ________ ____ ______ ____ _______ ________ _______ ____.
__________ ______ ______ _______ ____ _____ _______ _______ _____.
____ ____ ___ __________ _______ ____ ____ ___.
________ _______ ______ _________ ____ _____ __________ __________.
___ ______ _____ __________ ____ ______ ______ _________ ________ ___ ______ _____.
_____ _________ __________ __________ ___ _____ ______ ________ _____ __________ _____ ___.
____ ____ _____ __________ _________ _______.
______ ________ _______ __________ _________ __________.
__________ ________ ____ __________ _______.
_____ _______ ____ ______ ___ __________ ____ ______ __________ ___ _______.
___ _____ ______ _____ ___ ________ _______ _______.
_____ ______ _________ _____ __________ _________ __________ ______.
_______ ____ ______ ______ ___ _____ _____ ________ ___ ________ _______ __________.
____ _________ ___ ____ _____ ______ ________ ___ _________ ____.
_______ _____ ______ ____ ___.
____ ____ _____ _____ ____.
__________ ______ __________ ___ _______.
_____ ____ _____ _________ ________.
__________ ___ ____ _______ _____ ______ ______ _______ _____ __________ _______.
______ _____ _________ ______ _____ ______ ______ _____ ___ ___ ____.
_____ ______ _________ _________ ____ _______ _______ ____ __________ ______.
________ ____ ____ ________ ___ _______ ________ __________ _____ ____ _________ ______.
_________ ______ ______ ____ ________ ___ ______ ________.
_______ ____ ______ _____ _______ _________ __________ ____ __________ _____.
__________ __________ _________ _____ ______ ______ ______ ______ _________ __________.
_______ ______ ____ ___ _________ _______ ___ ________ ______ _____.
_________ ________ ___ __________ ________.
_________ _____ _____ __________ _____ ________ _______ ______ _______ ___ __________.
_______ _______ ________ ___ ___ ________ ________.
__________ _____ __________ ___ _________ ____ __________.
_______ ________ _____ ______ _____ __________ _____ ______ ________ __________.
________ _________ ___ ______ _____ __________ __________ ___ _________ ___ ________ ______.
________ _______ _______ ______ ____ _________ _____ _________ _____ _________ _____.
__________ __________ ________ ___ ____ _______ _________ _________ ____ _____ ________.
_________ __________ _____ _________ ___ _______ _____ _____.
_________ ____ _______ __________ ____ __________ _______ ____.
_______ _________ __________ ______ ______ ___ ___ ____ ______ _________ ______ ________.
_________ ________ _______ ____ _________ _____.
_____ __________ _____ _____ ______ _______ __________ ________ _____ _________ ________ __________.
______ ________ ________ _________ _____ ________ _________ ____ _________ __________ _____.
___ ____ ___ ___ _______ ________ ___ ___ _________ ____ ____.
_____ ________ _____ _______ _________ _____ _________ _____.
___ _____ ______ ________ _________ _________ ____ _____ ________ ________.
____ _________ _________ _________ ______ __________.
_______ ___ _____ ______ _______ _________ ___ ____ _____.
___ _________ ____ ________ ____ _______ ___ ________ ________ ___.
_______ ______ ______ ______ ___ ______ ________ ______ _____.
____ _________ ___ ________ _______.
_______ __________ ______ ________ ______ __________ _________ __________ _____.
_____ ______ ______ _________ _____ _______ ________.
______ __________ _________ __________ ___ ____ _____ _______.
_________ ________ ________ ____ _______ _________.
_______ ____ _______ _____ ___ _________ _______ ______ __________.
________ ___ _____ ____ _______ __________.
_________ _____ ________ _______ ___ ________.
_________ ___ _________ __________ _____ ________ __________ _____ _______ ________ ______ _______.
___ _____ ____ _________ __________ ______ _____ ______ _______ ____ ________ ___.
_____ ____ ___ ____ ______ ___ _________ _________ ________.
____ _________ ________ _____ ____ __________ ________ _______.
____ ____ _________ ________ _________ _____ _________ ___ ____ __________ ________.
________ __________ ________ _____ _________ ______ _____ ___ _______ _______ _________ _________.
________ _________ _______ ___ ____.
____ _____ _______ ____ _________ _________.
____ ______ _______ __________ __________ ______ ____ ____ _______.
____ ____ _______ ___ ___ _______ ______ ______ ___ _______.
Skip in 10
In C++, employee information can be stored and displayed efficiently by using structures, classes, arrays, or vectors. When an organization has several employees, it is important to store details such as employee ID, name, department, designation, age, salary, and contact information in an organized manner. A suitable C++ program can collect the information of employees and then display all the records in a clear tabular format. This makes the information easy to read, compare, and manage. A structure is an appropriate choice when the program needs to group different types of data belonging to the same employee. For example, an employee record may contain an integer employee ID, a string for the employee name, a string for department, a string for designation, an integer for age, and a floating-point value for salary. These different variables can be combined into one user-defined data type called `Employee`. The basic structure can be declared as follows: ```cpp struct Employee { int id; string name; string department; string designation; int age; double salary; }; ``` To use the `string` data type, the `` header file is required. The `` header file is used for input and output operations. If multiple employee records are required, an array of structures can be used. For example: ```cpp Employee emp[100]; ``` This declaration creates space for storing information about 100 employees. The actual number of employees can be entered by the user at runtime. The program can first ask the user to enter the number of employees. A `for` loop can then be used to accept information for each employee. For example: ```cpp int n; cout << "Enter number of employees: "; cin >> n; for (int i = 0; i < n; i++) { cout << "\nEnter details of Employee " << i + 1 << ":\n"; cout << "Employee ID: "; cin >> emp[i].id; cout << "Name: "; cin >> emp[i].name; cout << "Department: "; cin >> emp[i].department; cout << "Designation: "; cin >> emp[i].designation; cout << "Age: "; cin >> emp[i].age; cout << "Salary: "; cin >> emp[i].salary; } ``` After collecting the information, the records can be displayed using another `for` loop. To display the data appropriately, headings can be provided for every field. The `setw()` function from the `` header can be used to arrange the information into columns. For example: ```cpp cout << left << setw(10) << "ID" << setw(20) << "Name" << setw(20) << "Department" << setw(20)
_______ ____ __________ ________ _________ ___ __________ __________ ________ _________._______ ________ ____ __________ ____ _______ ___ _________.
________ ___ __________ ________ ______ ________ _____.
_______ _____ ______ ________ _____ ____ ________.
__________ _________ ___ _______ ___ ___ _______ _________ ________ ______.
______ _____ ________ _________ _____ _____ ___ _____ ________.
__________ _____ ___ ____ _______ ___ ______ _________ __________.
_____ ______ ____ _______ _______ ______ __________ _____ _____ __________ _______.
______ ______ ___ ________ ___ _______.
________ _______ ____ ___ ___ ______ _________ _________ __________ _______ _______.
_________ ________ ___ ______ ___ ______.
___ ____ ____ ____ ___ ____ _______ _____ ________ ________ ________ ________.
___ _______ _________ ______ ___ ____ ________.
_________ _____ _____ _________ ______ ______ _________ ________ __________ _____.
___ ______ __________ ______ ________.
______ __________ _________ ______ ______ ____ ______ ___ ______ ____ _____ ______.
_______ __________ ___ ___ ____ _______ ______ _______.
_______ ______ ______ _______ ___ _________.
______ ____ _________ _______ ____ _________.
____ ___ ______ ____ ______ ________ _______ _________ _______ ___.
______ _________ __________ ___ _________ ______ ___.
___ _______ ______ _______ __________ ________.
__________ ________ _____ ______ ___ _________ _________.
________ ___ _____ _________ _________.
_____ _______ _______ ___ ____ ___ ________.
__________ _______ ______ ______ _________ ________ __________ _____ ___ ______.
_______ _______ ______ ________ ____ ________ ____ _________ _____.
______ _____ ______ _________ _____ ____ __________ _______ __________ ___ ____.
________ ____ ______ ___ ___ ________ ___ _____ ______ ________.
_________ ____ ______ ___ ________ __________ ________ ___ _________.
_____ ____ ________ ______ _____ _________ __________ _____.
_____ __________ ________ ______ ___ ________ ________ _____ ____ ___.
____ ____ _____ _______ ______ ____ ____ _______.
________ _______ _______ __________ ___ ________ ___ ___ ________ ______ _______.
_______ ____ ______ _________ _______ __________ ___ ___ ________ _____ _____ ______.
______ _________ ____ ______ ________.
________ ________ _________ ___ ____ ___ ______ ______ ________ _________.
_______ _________ _______ ___ _________.
_____ ____ ______ _____ __________ ______ ____ _____ ________ ____ ________ _________.
___ ____ ________ ____ ______ ____ _______ ________ _______ ____.
__________ ______ ______ _______ ____ _____ _______ _______ _____.
____ ____ ___ __________ _______ ____ ____ ___.
________ _______ ______ _________ ____ _____ __________ __________.
___ ______ _____ __________ ____ ______ ______ _________ ________ ___ ______ _____.
_____ _________ __________ __________ ___ _____ ______ ________ _____ __________ _____ ___.
____ ____ _____ __________ _________ _______.
______ ________ _______ __________ _________ __________.
__________ ________ ____ __________ _______.
_____ _______ ____ ______ ___ __________ ____ ______ __________ ___ _______.
___ _____ ______ _____ ___ ________ _______ _______.
_____ ______ _________ _____ __________ _________ __________ ______.
_______ ____ ______ ______ ___ _____ _____ ________ ___ ________ _______ __________.
____ _________ ___ ____ _____ ______ ________ ___ _________ ____.
_______ _____ ______ ____ ___.
____ ____ _____ _____ ____.
__________ ______ __________ ___ _______.
_____ ____ _____ _________ ________.
__________ ___ ____ _______ _____ ______ ______ _______ _____ __________ _______.
______ _____ _________ ______ _____ ______ ______ _____ ___ ___ ____.
_____ ______ _________ _________ ____ _______ _______ ____ __________ ______.
________ ____ ____ ________ ___ _______ ________ __________ _____ ____ _________ ______.
_________ ______ ______ ____ ________ ___ ______ ________.
_______ ____ ______ _____ _______ _________ __________ ____ __________ _____.
__________ __________ _________ _____ ______ ______ ______ ______ _________ __________.
_______ ______ ____ ___ _________ _______ ___ ________ ______ _____.
_________ ________ ___ __________ ________.
_________ _____ _____ __________ _____ ________ _______ ______ _______ ___ __________.
_______ _______ ________ ___ ___ ________ ________.
__________ _____ __________ ___ _________ ____ __________.
_______ ________ _____ ______ _____ __________ _____ ______ ________ __________.
________ _________ ___ ______ _____ __________ __________ ___ _________ ___ ________ ______.
________ _______ _______ ______ ____ _________ _____ _________ _____ _________ _____.
__________ __________ ________ ___ ____ _______ _________ _________ ____ _____ ________.
_________ __________ _____ _________ ___ _______ _____ _____.
_________ ____ _______ __________ ____ __________ _______ ____.
_______ _________ __________ ______ ______ ___ ___ ____ ______ _________ ______ ________.
_________ ________ _______ ____ _________ _____.
_____ __________ _____ _____ ______ _______ __________ ________ _____ _________ ________ __________.
______ ________ ________ _________ _____ ________ _________ ____ _________ __________ _____.
___ ____ ___ ___ _______ ________ ___ ___ _________ ____ ____.
_____ ________ _____ _______ _________ _____ _________ _____.
___ _____ ______ ________ _________ _________ ____ _____ ________ ________.
____ _________ _________ _________ ______ __________.
_______ ___ _____ ______ _______ _________ ___ ____ _____.
___ _________ ____ ________ ____ _______ ___ ________ ________ ___.
_______ ______ ______ ______ ___ ______ ________ ______ _____.
____ _________ ___ ________ _______.
_______ __________ ______ ________ ______ __________ _________ __________ _____.
_____ ______ ______ _________ _____ _______ ________.
______ __________ _________ __________ ___ ____ _____ _______.
_________ ________ ________ ____ _______ _________.
_______ ____ _______ _____ ___ _________ _______ ______ __________.
________ ___ _____ ____ _______ __________.
_________ _____ ________ _______ ___ ________.
_________ ___ _________ __________ _____ ________ __________ _____ _______ ________ ______ _______.
___ _____ ____ _________ __________ ______ _____ ______ _______ ____ ________ ___.
_____ ____ ___ ____ ______ ___ _________ _________ ________.
____ _________ ________ _____ ____ __________ ________ _______.
____ ____ _________ ________ _________ _____ _________ ___ ____ __________ ________.
________ __________ ________ _____ _________ ______ _____ ___ _______ _______ _________ _________.
________ _________ _______ ___ ____.
____ _____ _______ ____ _________ _________.
____ ______ _______ __________ __________ ______ ____ ____ _______.
____ ____ _______ ___ ___ _______ ______ ______ ___ _______.
IGNOU ACADEMY
Your IGNOU journey, made easier.
- Solved Assignments
- Study Notes
- Guess Papers
- Question Papers
Continue Reading — It's Free
Sign in with Google to unlock more of this answer.
✓ Free access
✓ Unlock up to 60% of the answer
✓ No payment required
✓ Unlock up to 60% of the answer
✓ No payment required
Quick Google sign-in. No separate registration form.