Question
i need to make a Employee and an organization; employee must have name, birthday, organization, and jobtitle. the organization must of organization name and number
i need to make a Employee and an organization; employee must have name, birthday, organization, and jobtitle. the organization must of organization name and number of employees. i understand how to make the two however i dont know how to keep track of how many employees belong to companyA and companyB" furthermore, i need to be able to compare employees to see if they are the same person.the exact problom is below.
public class Employee { private String name; private int idNumber = 0; String birthDay; private Organization organization; private String jobTitle; public Employee(String name, String birthDay, String jobTitle, Organization organization) { this.name = name; this.idNumber = this.idNumber++; this.birthDay = birthDay; this.organization = organization; this.jobTitle = jobTitle; } public String getJobTitle() { return jobTitle; } public Organization getOrganization() { return organization; } public String getBirthDay() { return birthDay; } public int getIdNumber() { return idNumber; } public String getName() { return name; } public String toString() { return "Employee: " + name + " Job Title: " + jobTitle + " Organization:" + organization + " BirthDate: " + birthDay; } }
******************************************************************************************************************************************
public class Organization { private String organization; private int employeeCount; public Organization(String organization){ this.organization=organization; //incrament employee counte for organization passed in some how. } public int getEmployeeCount() { return employeeCount; } public String getOrganization() { return organization; } }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started