0% found this document useful (0 votes)
13 views2 pages

Simple Company Employee Management Code

The document describes a program for managing a company, allowing for the addition of employees and displaying their details. It includes a JavaScript implementation with classes for Employee and Company, where employees can be added to a company and their information displayed. Example usage demonstrates creating a company and adding two employees.

Uploaded by

mukandeliano27
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views2 pages

Simple Company Employee Management Code

The document describes a program for managing a company, allowing for the addition of employees and displaying their details. It includes a JavaScript implementation with classes for Employee and Company, where employees can be added to a company and their information displayed. Example usage demonstrates creating a company and adding two employees.

Uploaded by

mukandeliano27
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Comment

This program manages a simple company with functionalities to add employees and
display their details.

Code

// [Link]

class Employee {
constructor(name, position, salary) {
[Link] = name; // Employee's name
[Link] = position; // Employee's position
[Link] = salary; // Employee's salary
}

displayInfo() {
// Display employee information
[Link](`Name: ${[Link]}, Position: ${[Link]}, Salary:
}
}

class Company {
constructor(name) {
[Link] = name; // Company's name
[Link] = []; // Array to hold employees
}

addEmployee(employee) {
// Add a new employee to the company
[Link](employee);
}

displayEmployees() {
// Display all employees in the company
}
}

// Example usage
const myCompany = new Company("Tech Solutions");
const emp1 = new Employee("Alice", "Developer", 70000);
const emp2 = new Employee("Bob", "Manager", 80000);

[Link](emp1);
[Link](emp2);
[Link]();

You might also like