Textbook solution for data structures abstraction and design using java 2nd edit
ID: 648300 • Letter: T
Question
Textbook solution for data structures abstraction and design using java 2nd edition chapter 4.5 Textbook page 240 - Programming Project 6
Textbook solution for data structures abstraction and design using java 2nd edition chapter 4.5 Textbook page 240 - Programming Project 6 Textbook page 240 - Programming Project 6 Write a menu-driven program that uses an array of queues to keep track of a group of executives as they are transferred from one department to another, get paid. or become unemployed. Executives within a department are paid based on their seniority, with the person who has been in the department the longest receiving the most money. Each person in the department receives $1000 iii salary for each person in her/his department having less seniority than s/lie has. Persons who are unemployed receive no compensation. Your program should be able to process the following set of commands: Hint 1: You might want to include a table that contains each executive's name and information and the location of the queue that contains his or her nanme, to make searching more efficient Hint 2: To properly test your program. you will need a lot of executives. You can. if you want, write a method to randomly generate strings of characters to use as names, and then randomly put them in departments. For example, I might decide that my names will be five characters and I have ten departments. Thus some of my data might be Zusyz and is randomly put in department 3, Biith is randomly put into department 7, etc. These aren't actual names, but this allows me to generate a lot of data easily.Explanation / Answer
Company.java import java.util.Queue; import java.util.PriorityQueue; /** * * @author tue65926 * Ramanjit Khakh */ public class Company { public Queue[] department = new Queue[3]; public Company(){ Queue sales = new PriorityQueue(); Queue research = new PriorityQueue(); Queue accounting = new PriorityQueue(); department[0] = accounting; department[1] = research; department[2] = sales; } public void join(String person, String depart){ if(depart.equalsIgnoreCase("accounting")){ department[0].add(person); } else if (depart.equalsIgnoreCase("research")){ department[1].add(person); }else if (depart.equalsIgnoreCase("sales")){ department[2].add(person); }else{ System.out.println("ERROR department not found"); } } public void quit(String person){ for(int u = 0; uRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.