public class Employee {
private int employeeNumber;
private String employeeName;
private String employeeAddress;
private int employeeAge;
private double employeeSalary;
// private static int numberOfEmployees = 1;
public Employee() {
this.employeeNumber = numberOfEmployees++;
this.employeeName = "";
this.employeeAddress = "";
this.employeeAge = 0;
this.employeeSalary = 0.0;
}
public Employee(String employeeName, String employeeAddress, int employeeAge, double employeeSalary) {
this.employeeNumber = numberOfEmployees++;
this.employeeName = employeeName;
this.employeeAddress = employeeAddress;
this.employeeAge = employeeAge;
this.employeeSalary = employeeSalary;
}
Script
function empleados () {
const empleados = [
{nombre: 'Vladimir', salario: 1000},
{nombre: 'Alexis', salario: 2000}
]
return empleados.length
}
empleados()
enum Departamento {
VENTAS, MARKETING, DESARROLLO
}
enum Puesto {
PROGRAMADOR, ANALISTA, JEFE_DE_PROYECTO
}
class Empleado {
// Atributos
public static int contadorEmpleados;
private int numEmpleado;
private String nombre;
private int anyoAlta;
private Departamento departamento;
private double sueldo;
private Puesto puesto;
// Constructor
public Empleado(String nombre, int anyoAlta, Departamento departamento, double sueldo, Puesto puesto) {
this.numEmpleado = ++contadorEmpleados;
this.nombre = nombre;
this.anyoAlta = anyoAlta;
this.departamento = departamento;
this.sueldo = sue
Script
function employeeCount(employees) {
// employeeCount is a function that takes in an array of people
var count = 0;
// Inside the function we'll set a variable called count to 0
for (var i = 0; i < employees.length; i++) {
// Then we'll loop through the array of employees
if (employees[i].isEmployed) {
// If the person at the current index of our loop is employed
count++;
// Add 1 to our count
}
}
// Lastly, return the total number of employees we counted.
return count;
}
employees = [
{name: "Sam", isEmployed: true},
{name: "Sasha", isEmployed: false},
{name: "Derek", isEmployed: true},
{name: "Terri", isEmployed: true},
{name: "Michael", isEmployed: false}
];
employeeCount(employees); // 3
public Integer getNumberOfEmployees() {
return employees.size();
}
public void HowManyEmployeesWorkInCompany() {
System.out.println(this.name + " has " + this.employees + " employees in the company");
}
public class Employee {
private enum Departamento {
Sales, Marketing, Development
}
private enum Cargo {
PROGRAMMER, ANALYST, PROJECT_MANAGER
}
private static int nextId = 0;
private int id;
private String nome;
private int ano;
private Departamento departamento;
private Cargo cargo;
private double salario;
public Employee(String nome, int ano, Departamento departamento, Cargo cargo, double salario){
this.nome = nome;
this.ano = ano;
this.departamento = departamento;
this.cargo = cargo;
this.salario = salario;
id = ++nextId;
}
public static void main(String[] args) {
Employee employee = new Employee("John", 2019, Departamento.Development, Cargo.PROGRAMMER, 400);
System.out.println(employ
public class Employee{
public static void main(String[] args){
System.out.println("Hello, world")
}
}
public static int getNumeroEmpleadosTrabajando()
{
int cont = 0;
for (int i = 0; i < Main.empleados.length; i++)
{
if (Main.empleados[i].getHoras() > 0)
{
cont++;
}
}
return cont;
}
public class Employee {
private int employeeNumber;
private String name;
private int yearIncorporation;
private Department department;
private double salary;
private Position position;
private static int employeeCounter = 1001;
public Employee(String name, int yearIncorporation, Department department, double salary, Position position) {
this.employeeNumber = employeeCounter++;
this.name = name;
this.yearIncorporation = yearIncorporation;
this.department = department;
this.salary = salary;
this.position = position;
}
public int getEmployeeNumber() {
return employeeNumber;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getYearIncorporation() {
return yearIncorporation;
}
public void setYearIncorporation(int yearIncorporation) {
this.
public class Employee {
private int employeeNumber;
private String name;
private int yearOfIncorporation;
private Department department;
private float salary;
private Position position;
private static int counter;
public Employee(String name, int yearOfIncorporation, Department department, float salary, Position position) {
this.name = name;
this.yearOfIncorporation = yearOfIncorporation;
this.department = department;
this.salary = salary;
this.position = position;
Employee.counter++;
this.employeeNumber = Employee.counter;
}
public class Employee{
private int number;
private String name;
private Date year;
private Department dept;
private double salary;
private Position pos;
public Employee(String name, Date year, Department dept, double salary, Position pos) {
this.name = name;
this.year = year;
this.dept = dept;
this.salary = salary;
this.pos = pos;
number = 1;
}
public String toString() {
return number + ", " + name + ", " + year + ", " + salary + ", " + pos + ", " + dept;
}
public boolean equals(Employee e) {
return e.number == number && e.name.equals(name) && e.year.equals(year) && e.dept == dept && e.salary == salary && e.pos == pos;
}
public int getNumber() {
return number;
}
}
Script
empresa.empleadosActuales()
public int getNumEmployees() {
return this.numEmployees;
}
Script
function numberOfEmployees() {
return this.employees.length;
}
numberOfEmployees() // 4
public class Employee {
private String name;
private String jobTitle;
private int age;
private String phoneNumber;
private String email;
private String address;
private String startDate;
private String salary;
public Employee(String name, String jobTitle, int age, String phoneNumber, String email, String address, String startDate, String salary) {
this.name = name;
this.jobTitle = jobTitle;
this.age = age;
this.phoneNumber = phoneNumber;
this.email = email;
this.address = address;
this.startDate = startDate;
this.salary = salary;
}
}
Script
const employees = [
{
id: 1,
name: 'john',
isWorking: true
},
{
id: 1,
name: 'john',
isWorking: true
}
]
let count = 0;
for (let i = 0; i < employees.length; i++) {
if (employees[i].isWorking === true) {
count++;
}
}
console.log(count);
import java.util.*;
enum Department {SALES, MARKETING, DEVELOPMENT}
enum Position {PROGRAMMER, ANALYST, PROJECT_MANAGER}
class Employee {
private int employeeNumber;
private String name;
private int incorporationYear;
private Department department;
private float salary;
private Position position;
private static int counter;
Employee(){
counter++;
this.employeeNumber=counter;
}
public int getEmployeeNumber() {
return employeeNumber;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getIncorporationYear() {
return incorporationYear;
}
public void setIncorporationYear(int incorporationYear) {
this.incorporationYear = incorporationYear;
}
public Department getDepartment() {
return department;
}
public void setDepartment(int department)
public class Employee {
private int employeeNumber;
private String name;
private int yearOfIncorporation;
private Department department;
private float salary;
private Position position;
private static int count = 0;
public Employee(String name, int yearOfIncorporation, Department department, float salary, Position position) {
this.name = name;
this.yearOfIncorporation = yearOfIncorporation;
this.department = department;
this.salary = salary;
this.position = position;
this.employeeNumber = ++count;
}
public int getEmployeeNumber() {
return employeeNumber;
}
public String getName() {
return name;
}
public int getYearOfIncorporation() {
return yearOfIncorporation;
}
public Department getDepartment() {
return department;
}
public enum Department {
SALES(10), MARKETING(20), DEVELOPMENT(30);
private int num;
private Department(int num){
this.num = num;
}
public int getNum() {
return num;
}
}
public enum Position {
PROGRAMMER(1), ANALYST(2), PROJECT_MANAGER(3);
private int num;
private Position(int num){
this.num = num;
}
public int getNum() {
return num;
}
}
public class Employee {
private String name;
private int year;
private Department department;
private double salary;
private Position position;
private static int id = 0;
private int employeeId;
public Employee(String name, int year, Department department, double salary, Position position) {
this.name = name;
this.year = year;
this.department = department;
this.salary = salary;
public enum Department
{
SALES(10), MARKETING(20), DEVELOPMENT(30);
private final int value;
private Department(int value)
{
this.value = value;
}
public int getValue()
{
return value;
}
}
public enum Occupation
{
PROGRAMMER(1), ANALYST(2), PROJECT_MANAGER(3);
private final int value;
private Occupation(int value)
{
this.value = value;
}
public int getValue()
{
return value;
}
}
public class Employee
{
private static int numberOfEmployees = 0;
private int number;
private String name;
private int yearOfIncorporation;
private Department department;
private double salary;
private Occupation occupation;
public Employee(String name, int yearOfIncorporation, int dep, double salary, int occ)
{
this.name = name
public class Empleado {
private int numero;
private String nombre;
private int añoDeIngreso;
private String departamento;
private double salario;
private String cargo;
public Empleado(String nombre, int añoDeIngreso, String departamento, double salario, String cargo) {
numero = (int) Math.random();
this.nombre = nombre;
this.añoDeIngreso = añoDeIngreso;
this.departamento = departamento;
this.salario = salario;
this.cargo = cargo;
}
public int getNumero() {
return numero;
}
public void setNumero(int numero) {
this.numero = numero;
}
public String getNombre() {
return nombre;
}
public void setNombre(String nombre) {
this.nombre
enum Department {
SALES, MARKETING, DEVELOPMENT
}
enum Position {
PROGRAMMER, ANALYST, PROJECT_MANAGER
}
class Employee {
int employeeNumber;
String name;
Date yearOfIncorporation;
Department department;
double salary;
Position position;
}
class EmployeesContainer {
List<Employee> employees;
void addEmployee() {
...
}
}
public int contarEmpleados(List<Empleado> lista) {
return lista.size();
}
public enum Departamentos {
SALES, MARKETING, DEVELOPMENT;
}
public enum Posiciones {
PROGRAMMER, ANALYST, PROJECT_MANAGER;
}
public class Empleado {
private static int id = 0;
private int numero;
private String nombre;
private int año_contrato;
private Departamentos departamento;
private int salario;
private Posiciones posicion;
public Empleado(String nombre, int año_contrato, Departamentos departamento, int salario, Posiciones posicion) {
this.numero = id;
this.nombre = nombre;
this.año_contrato = año_contrato;
this.departamento = departamento;
this.salario = salario;
this.posicion = posicion;
id++;
}
public int getNumero() {
public Employee(String name, double salary, int month, int day, int year) {
this.name = name;
this.salary = salary;
GregorianCalendar calender = new GregorianCalendar(year, month - 1, day);
hireDay = calender.getTime();
}
public static int getTotalEmployees(List<Employee> employees) {
if (employees == null) {
return 0;
}
return (int) employees
.stream()
.filter(e -> e.getWorking() == true)
.count();
}
package ejercicios;
public class Employee {
private String name;
private String year;
private String department;
private String salary;
private String ocupation;
private String id;
public Employee(String name, String year, String department, String salary, String ocupation, String id) {
super();
this.name = name;
this.year = year;
this.department = department;
this.salary = salary;
this.ocupation = ocupation;
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getYear() {
return year;
}
public void setYear(String year) {
this.year = year;
}
public String getDepartment() {
return department;
}
public
public enum Department {
DEVELOPMENT, SALES, MARKETING;
}
public enum Occupation {
PROGRAMMER, ANALYST, PROJECT_MANAGER;
}
public class Employee {
private static int id;
private String name;
private int year;
private Department department;
private int salary;
private Occupation occupation;
public Employee(String name, int year, Department department, int salary, Occupation occupation) {
id++;
this.name = name;
this.year = year;
this.department = department;
this.salary = salary;
this.occupation = occupation;
}
public static int getId() {
return id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getYear() {
return year;
}
Script
function employees() {
var count = 0;
for (var i = 0; i < data.length; i++) {
if (data[i].inoffice === true) {
count++;
}
}
return count;
}
employees();
public Employee(String firstName, String surname, String address, String phoneNumber) {
this.firstName = firstName;
this.surname = surname;
this.address = address;
this.phoneNumber = phoneNumber;
this.employeeNumber = employeeIdCounter++;
}
public class Employee{
private int number;
private String name;
private int year;
private Departament departament;
private double salary;
private Position position;
public Employee(String name, int year, Departament departament, double salary, Position position){
this.number = Employee.number + 1;
this.name = name;
this.year = year;
this.departament = departament;
this.salary = salary;
this.position = position;
Employee.number += 1;
}
//getter and setter methods
@Override
public String toString() {
return "Employee{" +
"number=" + number +
", name='" + name + '\'' +
", year=" + year +
", departament=" + departament +
", salary=" + salary +
", position=" + position +
'}';
}
@Override
public boolean equals(Object o) {
if (this == o) return true
public int getNumEmpleados(){
return this.numEmpleados;
}
package com.company;
import javax.swing.*;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
Employee employee = new Employee();
Department department = new Department();
Position position = new Position();
for (int i = 0; i < 5; i++) {
System.out.print("Name: ");
String name = input.nextLine();
System.out.print("Year of incorporation: ");
int incorporation = input.nextInt();
System.out.print("Department: ");
int dep = input.nextInt();
department.setDepartment(dep);
System.out.print("Salary: ");
int salary = input.nextInt();
System.out.print("Position: ");
int pos = input.nextInt();
position.setPosition(pos);
System.out.println();
employee.setEmployee(name, incorporation, department
Script
function employees() {
return 'We have ' + this.employees.length + ' employees';
}
package Employees;
import java.util.Scanner;
public class Employee {
private int numeroEmpleado;
private String nombre;
private int añoIngreso;
private Departamentos departamento;
private int salario;
private Puestos trabajo;
private static int contadorEmpleados = 0;
public Employee(String nombre, int añoIngreso, Departamentos departamento, int salario, Puestos trabajo) {
this.numeroEmpleado = ++contadorEmpleados;
this.nombre = nombre;
this.añoIngreso = añoIngreso;
this.departamento = departamento;
this.salario = salario;
this.trabajo = trabajo;
}
@Override
public String toString() {
return "El empleado numero: " + numeroEmpleado + "\nNombre: " +
public class Empleado {
private int numeroEmpleado;
private String nombre;
private int antiguedad;
private Departamento departamento;
private int sueldo;
private Puesto puesto;
// Constructores
public Empleado() {
numeroEmpleado = 1;
nombre = "";
antiguedad = 0;
departamento = Departamento.SALES;
sueldo = 0;
puesto = Puesto.PROGRAMADOR;
}
public Empleado(String nombre, int antiguedad, Departamento departamento, int sueldo, Puesto puesto) {
numeroEmpleado = 1;
this.nombre = nombre;
this.antiguedad = antiguedad;
this.departamento = departamento;
this.sueldo = sueldo;
this
import java.util.Scanner;
public class employee {
private int id;
private String name;
private int years;
String department;
private int salary;
String occupation;
enum department{
Sales,
Marketing,
Development;
}
enum occupation{
Programmer,
Analyst,
Project_Manager;
}
public employee() {
}
public void getData() {
System.out.println("Insert the name of the employee");
Scanner scan = new Scanner(System.in);
name = scan.nextLine();
System.out.println("Insert the years of the employee");
years = scan.nextInt();
System.out.println("Insert the department of the employee \n (Sales = 10, Marketing = 20, Development = 30)");
int dp = scan.next