Programming just give the best example you can on this progr

Programming just give the best example you can on this program doesn\'t have to be right. Just close as you think to the directions. When it searches for a name it needs to be able to search for up to four charcters first and last name.

EmployeeManager
EmployeeManager
- employees : Employee[]
- employeeMax : final int = 10
-currentEmployees : int
<<constructor>> EmployeeManager
+ addEmployee( type : int, fn : String, ln : String, m : char, g : char, en : int, ft : boolean, amount : double)
+ 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


public Employee[] findAllBySubstring(String find)
This method will return an array of all the Employees in the EmployeeManager that contain the substring passed. Create a new Employee array with the size of the number of current Employees. For every Employee call upon the RabinKarp method giving the search string as the concatenation of that Employee’s first and last name (no spaces). If the substring is found in the Employee add that Employee to the new array. After all have been checked, return the array.

private int charNumericValue(char c)
Given a character, returns the numeric value of the character, starting with A – 0 up to Z – 25. This should treat upper and lower case the same; that is passing it ‘A’ will return 0, passing it ‘a’ will also return 0. If a letter is not passed this method should create and throw an InvalidCharacterException as provided.

private int stringHash(String s)
Given a string, return the hash value of the entire String. Use a base 26 number system to create the hash as described in class. This will be needed only to find the hash of the substring that is being searched for and the base case for finding all substring hashes in the search string.

private int RabinKarpHashes(String s, int[] hashes, int pos, int length)
Finds the hash values of all substrings of size length in the String s, starting at index pos and down. These values are stored in the passed hashes array. This method must be recursive, using the technique as described in the Rabin-Karp lecture.

private int linearSearchRecursive(int[] data, int key, int pos)
This is a recursive linear search. Return the position of key in the data array, or -1 if it is not present. This method must be recursive.

private int RabinKarp(String name, String find)
Does the preprocessing of finding the hash for the substring, find using the stringHash method and the hashes of substrings in the search string using RabinKarpHashes method. Calls upon linearSearchRecursive to determine if the substring hash is in the collection of hashes and returns the result.

Other Notes:
•   Classes from the previous assignment will retain the same package structure. The new Exception is declared to be in its own package called “exceptions”.
•   Your EmployeeManager must import the InvalidCharacterException in order to use it
• Must use rolling hashes like hash(\"BCD\" = 26 x (28 - 0x26^2) +3 but four characters

Solution

package employee manager;

class EmployeeManager

{

public employees : Employee[]
final int employeeMax = 10
int current employee;
int EmployeeManager()

{

this.type=type;

this.fn=fn;

this.ln=ln;

this.m=m;

this.g=g;

this.rn=en;this.ft=ft,this.amount=amount;

}

public string addEmployee( type : int, fn : String, ln : String, m : char, g : char, en : int, ft : boolean, amount : double)

{

System.out.println(\"type: \" +this.type);

        System.out.println(\"fn: \"+ this.fn);

        System.out.println(\"ln: \" + this.ln);

        System.out.println(\"m: \"+this.m);

System.out.println(\"g: \" +this.g);

        System.out.println(\"en: \"+ this.en);

        System.out.println(\"ft: \" + this.ft);

        System.out.println(\"amount: \"+this.amount);

}

2) Remove employee :

public string removeEmployee( index : int)

{

public string listemployees()

{

}

4)Search for a name upto 4 characters :

private int linearSearchRecursive(int[] data, int key, int pos)

{

Robinkarp to hash and cal lliner search recursive :

Programming just give the best example you can on this program doesn\'t have to be right. Just close as you think to the directions. When it searches for a name
Programming just give the best example you can on this program doesn\'t have to be right. Just close as you think to the directions. When it searches for a name
Programming just give the best example you can on this program doesn\'t have to be right. Just close as you think to the directions. When it searches for a name

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site