SlideShare a Scribd company logo
1 of 8
Download to read offline
I only need help with four methods in the EmployeeManager class the methods are addRequest,
viewNextRequest, grantNextRequest, and outputRequests. I posted all of the other uml for
refernce on items that could be called.
UML DIAGRAM FOR AND DISCUSSION FOR EmptyListException
EmptyListException extends RuntimeException
<>EmptyListException( )
<>EmptyListException(name : String)
Constructors
The constructor that takes a String as an argument calls upon the super class constructor with that
String concatenated with “ is Empty”. The constructor that takes no argument calls upon the
other constructor with the argument of “List”.
This class should belong to the exceptions package.
UML DIAGRAM FOR AND DISCUSSION FOR ListNode
ListNode>
data : E
nextNode: ListNode
<>ListNode(d : E)
<>ListNode(d : E, node : ListNode)
+ setData(d : E)
+getData() : E
+setNext(next : ListNode)
+getNext() : ListNode
Notes on ListNode
ListNode(d : E) sets the nextNode to null, the rest of the implementation of the ListNode class is
self-explanatory as discussed in class
UML DIAGRAM FOR AND DISCUSSION FOR LinkedList
LinkedList>
firstNode : ListNode
lastNode : ListNode
numElements : int
name : String
<>LinkedList()
<>LinkedList(name : String)
+ insertAtFront(item : E)
+ insertAtBack(item : E)
+ removeFromFront() : E throws EmptyListException
+ removeFromBack() : E throws EmptyListException
+ removeItem(index : int) : E throws IndexOutOfBoundsException
+ getItem(index : int) : E throws IndexOutOfBoundsException
+ setItem(index : int, item : E) throws IndexOutOfBoundsException
+ findAndRemove(item : E) : Boolean
+ findItem(item E) : int
+ lengthIs() : int
+ clear()
+ toString()
+ isEmpty() : Boolean
+ sort() throws EmptyListException
Notes on LinkedList
Constructors
Both constructors set firstNode and lastNode to null and numElements to 0. The constructor that
takes a String sets the name data member to the String that is passed
insertAtFront(E)
Inserts the passed item to the front of the list
void insertAtBack(E)
Inserts the passed item in the back of the list
void removeFromFront()
Removes the first item in the list, and returns it. If the list is empty throws a new
EmptyListException with the message: “(Name of list) is Empty”
removeFromBack()
Removes the last item in the list, and returns it. If the list is empty throws a new
EmptyListException with the message: “(Name of list) is Empty”
removeItem(int)
Removes the element from the list at the given index. If that index does not exist within the
LinkedList an IndexOutOfBoundsException is thrown with the message: “(Name of List) Index
out of Range”. Returns the item removed.
getItem(int)
Returns the element at the given index. If that index does not exist within the LinkedList an
IndexOutOfBoundsException is thrown with the message: “(Name of List) Index out of Range”.
public setItem(int index, E item)
Attempts to place the passed item into the given index. If that index does not exist within the
LinkedList an IndexOutOfBoundsException is thrown with the message: “(Name of List) Index
out of Range”.
findAndRemove(E)
Attempts to find the passed item, if found removes it and returns true, if not returns false
findItem(E)
Attempts to find the passed item, if found returns the location, if not returns -1
lengthIs()
Returns the number of elements in the list
clear()
Removes all elements from the list
public String toString()
Returns a String containing all elements in the LinkedList separated by two new lines.
public void sort()
Sorts the contents of the LinkedList using the Selection Sort. If the list is empty throws a new
EmptyListException with the message: “(Name of list) is Empty”
isEmpty()
Returns true if empty, false if not
Both the ListNode and LinkedList class belong to the dataStructures package.
UML DIAGRAM FOR AND DISCUSSION FOR Queue
Queue>
private LinkedList list
<> Queue()
<> Queue(name : String)
+ enqueue(item : E)
+ dequeue() : E
+ lengthIs() : int
+ peek() : E
+ toString() : String
+ isEmpty() : Boolean
+ clear()
Notes on Queue
The composition technique of Queue is being used. That is, Queue HAS-A LinkedList, as
opposed to the inheritance technique where Queue IS-A LinkedList
The implementation of the methods is as discussed and demonstrated in class.
The Queue belongs to the dataStructures package.
Changes to EmployeeManager
The EmployeeManager is being updated to use LinkedLists to reference the Employees in the
ArrayList by sub-type. Changes need to be made where Employees are add/removed to perform
similar actions to the correct LinkedList. Additionally some of the previous methods can be
changed to take advantage of this addition. Since this now uses your LinkedList you must import
it from your dataStructures package.
Additionally, he EmployeeManager is adding a Queue for maintaining Employee vacation
requests. Some methods are being added to provide this new feature. Since this now uses your
Queue you must import it from your dataStructures package (changes in bold).
EmployeeManager
- employees : ArrayList
- employeeMax : final int = 10
- hourlyList : LinkedList
- salaryList : LinkedList
- commissionList : LinkedList
- vacationRequests : Queue
<> EmployeeManager()
+ addEmployee( type : int, fn : String, ln : String, m : char, g : char, en : int, ft : boolean, amount
: double) throws InvalidEmployeeNumberException
+ removeEmployee( index : int)
+ listAll()
+ listHourly()
+ listSalary()
+ listCommision()
+ resetWeek()
+ calculatePayout() : double
+ getIndex( empNum : int ) : int
+ annualRaises()
+ holidayBonuses() : double
+ increaseHours( index : int, amount : double)
+ increaseSales( index : int, amount : double)
+ findAllBySubstring(find : String) : Employee[]
- RabinKarp(name : String, find : String) : int
- stringHash(s : String) : int
- charNumericValue(c : char) : int
- RabinKarpHashes(s : String, hashes : int[], pos : int, length : int) : int
- linearSearchRecursive(nameHashes : int[], findHash : int, pos : int) : int
+ sort()
+ addRequest(empNum : int) : boolean
+ viewNextRequest() : Employee
+ grantNextRequest() : Employee
+ outputRequests()
Constructor
Create LinkedLists for the new data members. Name the lists (by using the appropriate
constructor) “Hourly List”, “Salary List”, and “Commission List”. Create the Queue object for
the new Queue data member. Name the Queue “Vacation Requests” by using the appropriate
constructor.
View Vacation Requests
Output the current vacation requests using the EmployeeManager’s outputRequests. Then
specifically outputs the next Employee to receive a request if present (see below example for
expected output).
Add Vacation Request
Asks user for the Employee number of the Employee to add to the request queue. If the
Employee exists outputs they have been added to the queue, if not outputs there is no Employee
(see below example for expected output).
Grant Vacation Request
Attempts to grant the next vacation request in the Queue. If it is successful outputs the Employee
that was granted the request, otherwise outputs there were no requests (see below example for
expected output).
EmptyListException extends RuntimeException
<>EmptyListException( )
<>EmptyListException(name : String)
Solution
Added Four New Methods in EmployeeManager.java
Adding Employee.java
public class Employee {
String firstName;
String lastName;
int type;
char m;
char g;
int en;
boolean ft;
double amount;
public Employee() {
// TODO Auto-generated constructor stub
}
public Employee(String firstName,String lastName,int type,char m,
char g,
int en,
boolean ft,
double amount) {
// TODO Auto-generated constructor stub
this.firstName = firstName;
this.lastName = lastName;
this.type = type;
this.m = m;
this.g = g;
this.ft = ft;
this.amount = amount;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
public char getM() {
return m;
}
public void setM(char m) {
this.m = m;
}
public char getG() {
return g;
}
public void setG(char g) {
this.g = g;
}
public int getEn() {
return en;
}
public void setEn(int en) {
this.en = en;
}
public boolean isFt() {
return ft;
}
public void setFt(boolean ft) {
this.ft = ft;
}
public double getAmount() {
return amount;
}
public void setAmount(double amount) {
this.amount = amount;
}
}
=====================================================================
====================
Adding EmployeeManager.java
import java.util.ArrayList;
public class EmployeeManager {
ArrayList list;
ArrayList requests;
public EmployeeManager() {
list = new ArrayList();
requests = new ArrayList();
}
public void addEmployee(String firstName,String lastName,int type,char m,
char g,
int en,
boolean ft,
double amount){
Employee e = new Employee(firstName, lastName, type, m, g, en, ft, amount);
list.add(e);
}
public boolean addRequest(int empNum){
requests.add(empNum);
return true;
}
public Employee viewNextRequest(){
if(requests.size()<=0)
return null;
else{
int num = requests.get(0);
for(int i=0;i

More Related Content

Similar to I only need help with four methods in the EmployeeManager class the .pdf

Need to be done in C++ Please Sorted number list implementation wit.pdf
Need to be done in C++  Please   Sorted number list implementation wit.pdfNeed to be done in C++  Please   Sorted number list implementation wit.pdf
Need to be done in C++ Please Sorted number list implementation wit.pdfaathiauto
 
Please add-modify the following to the original code using C# 1- Delet.docx
Please add-modify the following to the original code using C# 1- Delet.docxPlease add-modify the following to the original code using C# 1- Delet.docx
Please add-modify the following to the original code using C# 1- Delet.docxStewartt0kJohnstonh
 
computer notes - Data Structures - 5
computer notes - Data Structures - 5computer notes - Data Structures - 5
computer notes - Data Structures - 5ecomputernotes
 
Computer notes - Josephus Problem
Computer notes - Josephus ProblemComputer notes - Josephus Problem
Computer notes - Josephus Problemecomputernotes
 
I need help with this code working Create another project and add yo.pdf
I need help with this code working Create another project and add yo.pdfI need help with this code working Create another project and add yo.pdf
I need help with this code working Create another project and add yo.pdffantoosh1
 
Need to be done in C Please Sorted number list implementation with.pdf
Need to be done in C  Please   Sorted number list implementation with.pdfNeed to be done in C  Please   Sorted number list implementation with.pdf
Need to be done in C Please Sorted number list implementation with.pdfaathmaproducts
 
Creat Shape classes from scratch DETAILS You will create 3 shape cla.pdf
Creat Shape classes from scratch DETAILS You will create 3 shape cla.pdfCreat Shape classes from scratch DETAILS You will create 3 shape cla.pdf
Creat Shape classes from scratch DETAILS You will create 3 shape cla.pdfaromanets
 
There are a couple of new methods that you will be writing for this pr.pdf
There are a couple of new methods that you will be writing for this pr.pdfThere are a couple of new methods that you will be writing for this pr.pdf
There are a couple of new methods that you will be writing for this pr.pdfaamousnowov
 
Can you help me by answering this- The following function defined in c.pdf
Can you help me by answering this- The following function defined in c.pdfCan you help me by answering this- The following function defined in c.pdf
Can you help me by answering this- The following function defined in c.pdfSeanIC4Jamesn
 
Functions In Scala
Functions In Scala Functions In Scala
Functions In Scala Knoldus Inc.
 
2.(Sorted list array implementation)This sorted list ADT discussed .pdf
2.(Sorted list array implementation)This sorted list ADT discussed .pdf2.(Sorted list array implementation)This sorted list ADT discussed .pdf
2.(Sorted list array implementation)This sorted list ADT discussed .pdfarshin9
 
JBUG 11 - Scala For Java Programmers
JBUG 11 - Scala For Java ProgrammersJBUG 11 - Scala For Java Programmers
JBUG 11 - Scala For Java ProgrammersTikal Knowledge
 
Please help solve this in C++ So the program is working fin.pdf
Please help solve this in C++ So the program is working fin.pdfPlease help solve this in C++ So the program is working fin.pdf
Please help solve this in C++ So the program is working fin.pdfankit11134
 
The Ring programming language version 1.5.3 book - Part 22 of 184
The Ring programming language version 1.5.3 book - Part 22 of 184The Ring programming language version 1.5.3 book - Part 22 of 184
The Ring programming language version 1.5.3 book - Part 22 of 184Mahmoud Samir Fayed
 
Hi,I have added the methods and main class as per your requirement.pdf
Hi,I have added the methods and main class as per your requirement.pdfHi,I have added the methods and main class as per your requirement.pdf
Hi,I have added the methods and main class as per your requirement.pdfannaelctronics
 

Similar to I only need help with four methods in the EmployeeManager class the .pdf (20)

Need to be done in C++ Please Sorted number list implementation wit.pdf
Need to be done in C++  Please   Sorted number list implementation wit.pdfNeed to be done in C++  Please   Sorted number list implementation wit.pdf
Need to be done in C++ Please Sorted number list implementation wit.pdf
 
Please add-modify the following to the original code using C# 1- Delet.docx
Please add-modify the following to the original code using C# 1- Delet.docxPlease add-modify the following to the original code using C# 1- Delet.docx
Please add-modify the following to the original code using C# 1- Delet.docx
 
computer notes - Data Structures - 5
computer notes - Data Structures - 5computer notes - Data Structures - 5
computer notes - Data Structures - 5
 
Computer notes - Josephus Problem
Computer notes - Josephus ProblemComputer notes - Josephus Problem
Computer notes - Josephus Problem
 
I need help with this code working Create another project and add yo.pdf
I need help with this code working Create another project and add yo.pdfI need help with this code working Create another project and add yo.pdf
I need help with this code working Create another project and add yo.pdf
 
Need to be done in C Please Sorted number list implementation with.pdf
Need to be done in C  Please   Sorted number list implementation with.pdfNeed to be done in C  Please   Sorted number list implementation with.pdf
Need to be done in C Please Sorted number list implementation with.pdf
 
Collections
CollectionsCollections
Collections
 
Creat Shape classes from scratch DETAILS You will create 3 shape cla.pdf
Creat Shape classes from scratch DETAILS You will create 3 shape cla.pdfCreat Shape classes from scratch DETAILS You will create 3 shape cla.pdf
Creat Shape classes from scratch DETAILS You will create 3 shape cla.pdf
 
There are a couple of new methods that you will be writing for this pr.pdf
There are a couple of new methods that you will be writing for this pr.pdfThere are a couple of new methods that you will be writing for this pr.pdf
There are a couple of new methods that you will be writing for this pr.pdf
 
Can you help me by answering this- The following function defined in c.pdf
Can you help me by answering this- The following function defined in c.pdfCan you help me by answering this- The following function defined in c.pdf
Can you help me by answering this- The following function defined in c.pdf
 
JAVA PROGRAMMING - The Collections Framework
JAVA PROGRAMMING - The Collections Framework JAVA PROGRAMMING - The Collections Framework
JAVA PROGRAMMING - The Collections Framework
 
07 java collection
07 java collection07 java collection
07 java collection
 
Functions In Scala
Functions In Scala Functions In Scala
Functions In Scala
 
2.(Sorted list array implementation)This sorted list ADT discussed .pdf
2.(Sorted list array implementation)This sorted list ADT discussed .pdf2.(Sorted list array implementation)This sorted list ADT discussed .pdf
2.(Sorted list array implementation)This sorted list ADT discussed .pdf
 
JBUG 11 - Scala For Java Programmers
JBUG 11 - Scala For Java ProgrammersJBUG 11 - Scala For Java Programmers
JBUG 11 - Scala For Java Programmers
 
Please help solve this in C++ So the program is working fin.pdf
Please help solve this in C++ So the program is working fin.pdfPlease help solve this in C++ So the program is working fin.pdf
Please help solve this in C++ So the program is working fin.pdf
 
Java Generics - by Example
Java Generics - by ExampleJava Generics - by Example
Java Generics - by Example
 
Java Generics - by Example
Java Generics - by ExampleJava Generics - by Example
Java Generics - by Example
 
The Ring programming language version 1.5.3 book - Part 22 of 184
The Ring programming language version 1.5.3 book - Part 22 of 184The Ring programming language version 1.5.3 book - Part 22 of 184
The Ring programming language version 1.5.3 book - Part 22 of 184
 
Hi,I have added the methods and main class as per your requirement.pdf
Hi,I have added the methods and main class as per your requirement.pdfHi,I have added the methods and main class as per your requirement.pdf
Hi,I have added the methods and main class as per your requirement.pdf
 

More from arpitcomputronics

Neutrons cant be detected by the same detectors as alphas, betas, and.pdf
Neutrons cant be detected by the same detectors as alphas, betas, and.pdfNeutrons cant be detected by the same detectors as alphas, betas, and.pdf
Neutrons cant be detected by the same detectors as alphas, betas, and.pdfarpitcomputronics
 
List each hypothesis that is being tested in a twofactor ANOVA.S.pdf
List each hypothesis that is being tested in a twofactor ANOVA.S.pdfList each hypothesis that is being tested in a twofactor ANOVA.S.pdf
List each hypothesis that is being tested in a twofactor ANOVA.S.pdfarpitcomputronics
 
Marla begins walking at 3 mih toward the library.Her friend meets h.pdf
Marla begins walking at 3 mih toward the library.Her friend meets h.pdfMarla begins walking at 3 mih toward the library.Her friend meets h.pdf
Marla begins walking at 3 mih toward the library.Her friend meets h.pdfarpitcomputronics
 
Mrs. S confides in you that she is terrified of her husband. She rep.pdf
Mrs. S confides in you that she is terrified of her husband. She rep.pdfMrs. S confides in you that she is terrified of her husband. She rep.pdf
Mrs. S confides in you that she is terrified of her husband. She rep.pdfarpitcomputronics
 
In September of 2008, the FDIC paid JP Morgan Chase to purchase all .pdf
In September of 2008, the FDIC paid JP Morgan Chase to purchase all .pdfIn September of 2008, the FDIC paid JP Morgan Chase to purchase all .pdf
In September of 2008, the FDIC paid JP Morgan Chase to purchase all .pdfarpitcomputronics
 
In cocker spaniels, black coat color (B) is dominant over red (b), an.pdf
In cocker spaniels, black coat color (B) is dominant over red (b), an.pdfIn cocker spaniels, black coat color (B) is dominant over red (b), an.pdf
In cocker spaniels, black coat color (B) is dominant over red (b), an.pdfarpitcomputronics
 
In most healthy people, toxoplasmosis is an inapparent or mild dise.pdf
In most healthy people, toxoplasmosis is an inapparent or mild dise.pdfIn most healthy people, toxoplasmosis is an inapparent or mild dise.pdf
In most healthy people, toxoplasmosis is an inapparent or mild dise.pdfarpitcomputronics
 
Identify and briefly describe a diffusion network that you have expe.pdf
Identify and briefly describe a diffusion network that you have expe.pdfIdentify and briefly describe a diffusion network that you have expe.pdf
Identify and briefly describe a diffusion network that you have expe.pdfarpitcomputronics
 
how do the masses of the earth, oceans, atmosphere, and biosphere co.pdf
how do the masses of the earth, oceans, atmosphere, and biosphere co.pdfhow do the masses of the earth, oceans, atmosphere, and biosphere co.pdf
how do the masses of the earth, oceans, atmosphere, and biosphere co.pdfarpitcomputronics
 
If the mechanism of DNA replication (semi-conservative, conservative.pdf
If the mechanism of DNA replication (semi-conservative, conservative.pdfIf the mechanism of DNA replication (semi-conservative, conservative.pdf
If the mechanism of DNA replication (semi-conservative, conservative.pdfarpitcomputronics
 
EYCONNEC Cell Structures the arrangement of phospholipids in the plas.pdf
EYCONNEC Cell Structures the arrangement of phospholipids in the plas.pdfEYCONNEC Cell Structures the arrangement of phospholipids in the plas.pdf
EYCONNEC Cell Structures the arrangement of phospholipids in the plas.pdfarpitcomputronics
 
For the balance sheet, please categorize the following as short-term.pdf
For the balance sheet, please categorize the following as short-term.pdfFor the balance sheet, please categorize the following as short-term.pdf
For the balance sheet, please categorize the following as short-term.pdfarpitcomputronics
 
During World War II, the Manhattan Project developed the first nuclea.pdf
During World War II, the Manhattan Project developed the first nuclea.pdfDuring World War II, the Manhattan Project developed the first nuclea.pdf
During World War II, the Manhattan Project developed the first nuclea.pdfarpitcomputronics
 
Deoxy sugars are modified sugars where one or more OH groups are remo.pdf
Deoxy sugars are modified sugars where one or more OH groups are remo.pdfDeoxy sugars are modified sugars where one or more OH groups are remo.pdf
Deoxy sugars are modified sugars where one or more OH groups are remo.pdfarpitcomputronics
 
Determine truth value of the statement. Domain consists of all real .pdf
Determine truth value of the statement. Domain consists of all real .pdfDetermine truth value of the statement. Domain consists of all real .pdf
Determine truth value of the statement. Domain consists of all real .pdfarpitcomputronics
 
Describe the niches of at least 3 species of wildlife that might be .pdf
Describe the niches of at least 3 species of wildlife that might be .pdfDescribe the niches of at least 3 species of wildlife that might be .pdf
Describe the niches of at least 3 species of wildlife that might be .pdfarpitcomputronics
 
Define multicollinearity in the following termsa. In which type o.pdf
Define multicollinearity in the following termsa. In which type o.pdfDefine multicollinearity in the following termsa. In which type o.pdf
Define multicollinearity in the following termsa. In which type o.pdfarpitcomputronics
 
Convert the for loop Into MIPS Instructions. Use the sit instruction .pdf
Convert the for loop Into MIPS Instructions. Use the sit instruction .pdfConvert the for loop Into MIPS Instructions. Use the sit instruction .pdf
Convert the for loop Into MIPS Instructions. Use the sit instruction .pdfarpitcomputronics
 
Clarify how cells and molecules are linked to tissuesSolutionA.pdf
Clarify how cells and molecules are linked to tissuesSolutionA.pdfClarify how cells and molecules are linked to tissuesSolutionA.pdf
Clarify how cells and molecules are linked to tissuesSolutionA.pdfarpitcomputronics
 
Can you define fixed and variable costs Can you give some examples.pdf
Can you define fixed and variable costs  Can you give some examples.pdfCan you define fixed and variable costs  Can you give some examples.pdf
Can you define fixed and variable costs Can you give some examples.pdfarpitcomputronics
 

More from arpitcomputronics (20)

Neutrons cant be detected by the same detectors as alphas, betas, and.pdf
Neutrons cant be detected by the same detectors as alphas, betas, and.pdfNeutrons cant be detected by the same detectors as alphas, betas, and.pdf
Neutrons cant be detected by the same detectors as alphas, betas, and.pdf
 
List each hypothesis that is being tested in a twofactor ANOVA.S.pdf
List each hypothesis that is being tested in a twofactor ANOVA.S.pdfList each hypothesis that is being tested in a twofactor ANOVA.S.pdf
List each hypothesis that is being tested in a twofactor ANOVA.S.pdf
 
Marla begins walking at 3 mih toward the library.Her friend meets h.pdf
Marla begins walking at 3 mih toward the library.Her friend meets h.pdfMarla begins walking at 3 mih toward the library.Her friend meets h.pdf
Marla begins walking at 3 mih toward the library.Her friend meets h.pdf
 
Mrs. S confides in you that she is terrified of her husband. She rep.pdf
Mrs. S confides in you that she is terrified of her husband. She rep.pdfMrs. S confides in you that she is terrified of her husband. She rep.pdf
Mrs. S confides in you that she is terrified of her husband. She rep.pdf
 
In September of 2008, the FDIC paid JP Morgan Chase to purchase all .pdf
In September of 2008, the FDIC paid JP Morgan Chase to purchase all .pdfIn September of 2008, the FDIC paid JP Morgan Chase to purchase all .pdf
In September of 2008, the FDIC paid JP Morgan Chase to purchase all .pdf
 
In cocker spaniels, black coat color (B) is dominant over red (b), an.pdf
In cocker spaniels, black coat color (B) is dominant over red (b), an.pdfIn cocker spaniels, black coat color (B) is dominant over red (b), an.pdf
In cocker spaniels, black coat color (B) is dominant over red (b), an.pdf
 
In most healthy people, toxoplasmosis is an inapparent or mild dise.pdf
In most healthy people, toxoplasmosis is an inapparent or mild dise.pdfIn most healthy people, toxoplasmosis is an inapparent or mild dise.pdf
In most healthy people, toxoplasmosis is an inapparent or mild dise.pdf
 
Identify and briefly describe a diffusion network that you have expe.pdf
Identify and briefly describe a diffusion network that you have expe.pdfIdentify and briefly describe a diffusion network that you have expe.pdf
Identify and briefly describe a diffusion network that you have expe.pdf
 
how do the masses of the earth, oceans, atmosphere, and biosphere co.pdf
how do the masses of the earth, oceans, atmosphere, and biosphere co.pdfhow do the masses of the earth, oceans, atmosphere, and biosphere co.pdf
how do the masses of the earth, oceans, atmosphere, and biosphere co.pdf
 
If the mechanism of DNA replication (semi-conservative, conservative.pdf
If the mechanism of DNA replication (semi-conservative, conservative.pdfIf the mechanism of DNA replication (semi-conservative, conservative.pdf
If the mechanism of DNA replication (semi-conservative, conservative.pdf
 
EYCONNEC Cell Structures the arrangement of phospholipids in the plas.pdf
EYCONNEC Cell Structures the arrangement of phospholipids in the plas.pdfEYCONNEC Cell Structures the arrangement of phospholipids in the plas.pdf
EYCONNEC Cell Structures the arrangement of phospholipids in the plas.pdf
 
For the balance sheet, please categorize the following as short-term.pdf
For the balance sheet, please categorize the following as short-term.pdfFor the balance sheet, please categorize the following as short-term.pdf
For the balance sheet, please categorize the following as short-term.pdf
 
During World War II, the Manhattan Project developed the first nuclea.pdf
During World War II, the Manhattan Project developed the first nuclea.pdfDuring World War II, the Manhattan Project developed the first nuclea.pdf
During World War II, the Manhattan Project developed the first nuclea.pdf
 
Deoxy sugars are modified sugars where one or more OH groups are remo.pdf
Deoxy sugars are modified sugars where one or more OH groups are remo.pdfDeoxy sugars are modified sugars where one or more OH groups are remo.pdf
Deoxy sugars are modified sugars where one or more OH groups are remo.pdf
 
Determine truth value of the statement. Domain consists of all real .pdf
Determine truth value of the statement. Domain consists of all real .pdfDetermine truth value of the statement. Domain consists of all real .pdf
Determine truth value of the statement. Domain consists of all real .pdf
 
Describe the niches of at least 3 species of wildlife that might be .pdf
Describe the niches of at least 3 species of wildlife that might be .pdfDescribe the niches of at least 3 species of wildlife that might be .pdf
Describe the niches of at least 3 species of wildlife that might be .pdf
 
Define multicollinearity in the following termsa. In which type o.pdf
Define multicollinearity in the following termsa. In which type o.pdfDefine multicollinearity in the following termsa. In which type o.pdf
Define multicollinearity in the following termsa. In which type o.pdf
 
Convert the for loop Into MIPS Instructions. Use the sit instruction .pdf
Convert the for loop Into MIPS Instructions. Use the sit instruction .pdfConvert the for loop Into MIPS Instructions. Use the sit instruction .pdf
Convert the for loop Into MIPS Instructions. Use the sit instruction .pdf
 
Clarify how cells and molecules are linked to tissuesSolutionA.pdf
Clarify how cells and molecules are linked to tissuesSolutionA.pdfClarify how cells and molecules are linked to tissuesSolutionA.pdf
Clarify how cells and molecules are linked to tissuesSolutionA.pdf
 
Can you define fixed and variable costs Can you give some examples.pdf
Can you define fixed and variable costs  Can you give some examples.pdfCan you define fixed and variable costs  Can you give some examples.pdf
Can you define fixed and variable costs Can you give some examples.pdf
 

Recently uploaded

Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxJiesonDelaCerna
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxUnboundStockton
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...jaredbarbolino94
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitolTechU
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 

Recently uploaded (20)

Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptx
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docx
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptx
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 

I only need help with four methods in the EmployeeManager class the .pdf

  • 1. I only need help with four methods in the EmployeeManager class the methods are addRequest, viewNextRequest, grantNextRequest, and outputRequests. I posted all of the other uml for refernce on items that could be called. UML DIAGRAM FOR AND DISCUSSION FOR EmptyListException EmptyListException extends RuntimeException <>EmptyListException( ) <>EmptyListException(name : String) Constructors The constructor that takes a String as an argument calls upon the super class constructor with that String concatenated with “ is Empty”. The constructor that takes no argument calls upon the other constructor with the argument of “List”. This class should belong to the exceptions package. UML DIAGRAM FOR AND DISCUSSION FOR ListNode ListNode> data : E nextNode: ListNode <>ListNode(d : E) <>ListNode(d : E, node : ListNode) + setData(d : E) +getData() : E +setNext(next : ListNode) +getNext() : ListNode Notes on ListNode ListNode(d : E) sets the nextNode to null, the rest of the implementation of the ListNode class is self-explanatory as discussed in class UML DIAGRAM FOR AND DISCUSSION FOR LinkedList LinkedList> firstNode : ListNode lastNode : ListNode numElements : int name : String <>LinkedList() <>LinkedList(name : String) + insertAtFront(item : E) + insertAtBack(item : E)
  • 2. + removeFromFront() : E throws EmptyListException + removeFromBack() : E throws EmptyListException + removeItem(index : int) : E throws IndexOutOfBoundsException + getItem(index : int) : E throws IndexOutOfBoundsException + setItem(index : int, item : E) throws IndexOutOfBoundsException + findAndRemove(item : E) : Boolean + findItem(item E) : int + lengthIs() : int + clear() + toString() + isEmpty() : Boolean + sort() throws EmptyListException Notes on LinkedList Constructors Both constructors set firstNode and lastNode to null and numElements to 0. The constructor that takes a String sets the name data member to the String that is passed insertAtFront(E) Inserts the passed item to the front of the list void insertAtBack(E) Inserts the passed item in the back of the list void removeFromFront() Removes the first item in the list, and returns it. If the list is empty throws a new EmptyListException with the message: “(Name of list) is Empty” removeFromBack() Removes the last item in the list, and returns it. If the list is empty throws a new EmptyListException with the message: “(Name of list) is Empty” removeItem(int) Removes the element from the list at the given index. If that index does not exist within the LinkedList an IndexOutOfBoundsException is thrown with the message: “(Name of List) Index out of Range”. Returns the item removed. getItem(int) Returns the element at the given index. If that index does not exist within the LinkedList an IndexOutOfBoundsException is thrown with the message: “(Name of List) Index out of Range”. public setItem(int index, E item) Attempts to place the passed item into the given index. If that index does not exist within the LinkedList an IndexOutOfBoundsException is thrown with the message: “(Name of List) Index
  • 3. out of Range”. findAndRemove(E) Attempts to find the passed item, if found removes it and returns true, if not returns false findItem(E) Attempts to find the passed item, if found returns the location, if not returns -1 lengthIs() Returns the number of elements in the list clear() Removes all elements from the list public String toString() Returns a String containing all elements in the LinkedList separated by two new lines. public void sort() Sorts the contents of the LinkedList using the Selection Sort. If the list is empty throws a new EmptyListException with the message: “(Name of list) is Empty” isEmpty() Returns true if empty, false if not Both the ListNode and LinkedList class belong to the dataStructures package. UML DIAGRAM FOR AND DISCUSSION FOR Queue Queue> private LinkedList list <> Queue() <> Queue(name : String) + enqueue(item : E) + dequeue() : E + lengthIs() : int + peek() : E + toString() : String + isEmpty() : Boolean + clear() Notes on Queue The composition technique of Queue is being used. That is, Queue HAS-A LinkedList, as opposed to the inheritance technique where Queue IS-A LinkedList The implementation of the methods is as discussed and demonstrated in class. The Queue belongs to the dataStructures package. Changes to EmployeeManager The EmployeeManager is being updated to use LinkedLists to reference the Employees in the
  • 4. ArrayList by sub-type. Changes need to be made where Employees are add/removed to perform similar actions to the correct LinkedList. Additionally some of the previous methods can be changed to take advantage of this addition. Since this now uses your LinkedList you must import it from your dataStructures package. Additionally, he EmployeeManager is adding a Queue for maintaining Employee vacation requests. Some methods are being added to provide this new feature. Since this now uses your Queue you must import it from your dataStructures package (changes in bold). EmployeeManager - employees : ArrayList - employeeMax : final int = 10 - hourlyList : LinkedList - salaryList : LinkedList - commissionList : LinkedList - vacationRequests : Queue <> EmployeeManager() + addEmployee( type : int, fn : String, ln : String, m : char, g : char, en : int, ft : boolean, amount : double) throws InvalidEmployeeNumberException + removeEmployee( index : int) + listAll() + listHourly() + listSalary() + listCommision() + resetWeek() + calculatePayout() : double + getIndex( empNum : int ) : int + annualRaises() + holidayBonuses() : double + increaseHours( index : int, amount : double) + increaseSales( index : int, amount : double) + findAllBySubstring(find : String) : Employee[] - RabinKarp(name : String, find : String) : int - stringHash(s : String) : int - charNumericValue(c : char) : int - RabinKarpHashes(s : String, hashes : int[], pos : int, length : int) : int - linearSearchRecursive(nameHashes : int[], findHash : int, pos : int) : int + sort()
  • 5. + addRequest(empNum : int) : boolean + viewNextRequest() : Employee + grantNextRequest() : Employee + outputRequests() Constructor Create LinkedLists for the new data members. Name the lists (by using the appropriate constructor) “Hourly List”, “Salary List”, and “Commission List”. Create the Queue object for the new Queue data member. Name the Queue “Vacation Requests” by using the appropriate constructor. View Vacation Requests Output the current vacation requests using the EmployeeManager’s outputRequests. Then specifically outputs the next Employee to receive a request if present (see below example for expected output). Add Vacation Request Asks user for the Employee number of the Employee to add to the request queue. If the Employee exists outputs they have been added to the queue, if not outputs there is no Employee (see below example for expected output). Grant Vacation Request Attempts to grant the next vacation request in the Queue. If it is successful outputs the Employee that was granted the request, otherwise outputs there were no requests (see below example for expected output). EmptyListException extends RuntimeException <>EmptyListException( ) <>EmptyListException(name : String) Solution Added Four New Methods in EmployeeManager.java Adding Employee.java public class Employee { String firstName; String lastName;
  • 6. int type; char m; char g; int en; boolean ft; double amount; public Employee() { // TODO Auto-generated constructor stub } public Employee(String firstName,String lastName,int type,char m, char g, int en, boolean ft, double amount) { // TODO Auto-generated constructor stub this.firstName = firstName; this.lastName = lastName; this.type = type; this.m = m; this.g = g; this.ft = ft; this.amount = amount; } public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } public int getType() {
  • 7. return type; } public void setType(int type) { this.type = type; } public char getM() { return m; } public void setM(char m) { this.m = m; } public char getG() { return g; } public void setG(char g) { this.g = g; } public int getEn() { return en; } public void setEn(int en) { this.en = en; } public boolean isFt() { return ft; } public void setFt(boolean ft) { this.ft = ft; } public double getAmount() { return amount; } public void setAmount(double amount) { this.amount = amount; }
  • 8. } ===================================================================== ==================== Adding EmployeeManager.java import java.util.ArrayList; public class EmployeeManager { ArrayList list; ArrayList requests; public EmployeeManager() { list = new ArrayList(); requests = new ArrayList(); } public void addEmployee(String firstName,String lastName,int type,char m, char g, int en, boolean ft, double amount){ Employee e = new Employee(firstName, lastName, type, m, g, en, ft, amount); list.add(e); } public boolean addRequest(int empNum){ requests.add(empNum); return true; } public Employee viewNextRequest(){ if(requests.size()<=0) return null; else{ int num = requests.get(0); for(int i=0;i