Question
This question must be answered in java, and must incorporate stacks. Employee database, fire people based on service time Create a program that will keep
This question must be answered in java, and must incorporate stacks.
Employee database, fire people based on service time
Create a program that will keep track of a companies employees. Each employee will have a name and a hire date. The hire date will be in the format of mm/dd/year. This will be stored in another program called EmployeeInfo, and that will only have two pieces of information private instance data, which will be the name and the hire date.
The company has the options of hiring employees, or firing employees. Whenever they are hiring an employee, they must get a user inputted name and date of hire. If they want to fire one employee, they just enter "fire" for the name and the date of being fired, and this will fire the most recently hired employee. If you want to fire two employees, enter "fire 2" for the name. This will fire the two most recent hires. Three fires, enter "fire 3" for the name, etc. Make sure to print out everyone who is fired when you fire employees.
Try using this with the text file named NamesDatesFires.txt. Have it print out a list of all the hires and all the fires throughout the list.
Examples from NamesDatesFires.txt:
Anne 1/6/2017 Nick 1/28/2017 Tyler 2/20/2017 Lisa 2/28/2017 fire 3/14/2017 Zach 3/17/2017 Kim 3/30/2017 fire 4/1/2017 Ally 4/22/2017 Becky 5/12/2017 Abba 5/29/2017 fire 2 5/31/2017 Alina 6/19/2017 Nikki 6/22/2017 Markie 6/28/2017 fire 6/30/2017 Liana 7/8/2017 Elicia 7/16/2017 Jacob 8/4/2017 Monique 8/20/2017 Pat 8/29/2017 fire 3 8/31/2017 Sabina 9/3/2017 Katie 9/8/2017 Matt 10/1/2017 fire 10/3/2017 Liz 10/25/2017 Ryan 11/4/2017 Preksha 11/25/2017 Emmy 11/30/2017
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