Practical 12 (DSA)
Practical 12 (DSA)
12
Code :
#include <iostream>
#include <cstring> // For strcpy class Node {
using namespace std; Emp data;
Node *next;
class Emp {
int eid; public:
string name; Node(Emp d) : data(d), next(nullptr) {}
float basic;
// Getter Methods
public: Emp getdata() { return data; }
// Default Constructor Node *getnext() { return next; }
Emp() {
eid = 0; // Setter Methods
name = "Not Given"; void setdata(Emp d) { data = d; }
basic = 0.0; void setnext(Node *n) { next = n; }
} }; // End of Node Class
*************************************
1. Add Employee
2. Display Employees
3. Search By ID
4. Delete By ID
5. Edit Employee Data
6. Exit
*************************************
*************************************
1. Add Employee
2. Display Employees
3. Search By ID
4. Delete By ID
5. Edit Employee Data
6. Exit
*************************************
************************************
Employee Id : 23411
Name : C1
Salary : 20