Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

C++ WITH CLASSES In this assignment you will be creating the code for several cl

ID: 3813970 • Letter: C

Question

C++ WITH CLASSES

In this assignment you will be creating the code for several classes in order to implement a payroll program for a hospital. The program calculates the salaries for employees and volunteers. The program uses the following classes to achieve this goal:

* The StaffMember class: an abstract class that does not represent a particular type of employee. It is the ancestor of all employee classes, so it has the information that is shared among all employees.

* The Volunteer class: Volunteers work on special events and they are not paid. So this class represents a person who is not compensated monetarily for his or her work. It keeps track of only the basic information of a volunteer.

* The Employee class: represents an employee who gets paid at a particular rate each pay period.

* The Doctor class: represents an employee who earns 10% of the total costs of each surgery he or she may perform in addition to the normal pay rate.

* The Nurses class: represents an employee who is paid on hourly basis.

* The Executive class: represents an employee who may earn a bonus in addition to his or her normal pay rate.

* The Receptionist class: represents an employee who are paid their normal pay rate only.

* The driver file Hospital (where the main() is) creates a staff of employees and calls the pay() function to pay them. When the program is run, it should display the information about each employee and how much he/she should be paid.

Create the following StaffMember objects in order to find their pay rates:

Volunteer -> Name: Diana, Address: 11 South Paris Hill Rd., Phone: (984) 163-0125.

Volunteer -> Name: Ryan, Address: 625 Amerige Dr., Phone: (750) 837-4154.

Doctor -> Name: Gene, Address: 311 Delaware Ave., Phone: (275) 249-0721, SSN: 047-86-8586, Pay Rate: 150.0 $/hr, Number of working hours: 160, Surgeries: 3, Cost of each surgery: $10,000.

Nurse -> Name: Raye, Address: 933 Honey Creek St., Phone: (722) 521-3317, SSN: 417-46-7995, Pay Rate: 50.5 $/hr, Number of working hours: 80.

Nurse -> Name: Kristopher, Address: 99 Harvard St., Phone: (672) 790-2499, SSN: 517-42-5738, Pay Rate: 45.9 $/hr, Number of working hours: 100.

Nurse -> Name: Kristopher, Address: 99 Harvard St., Phone: (672) 790-2499, SSN: 517-42-5738, Pay Rate: 45.9 $/hr, Number of working hours: 100.

Receptionist -> Name: Sam, Address: 8426 Proctor St., Phone: (301) 936-4987, SSN: 365-07-9906, Pay Rate: 30.0 $/hr, Number of working hours: 160.

Executive -> Name: Sean, Address: 6200 Seaside Dr., Phone: (361) 956-4787, SSN: 678-16-4701, Pay Rate: 130.0 $/hr, Number of working hours: 160, Bonus: $12,000.

Explanation / Answer

import java.util.Scanner;
import java.math.*;

/* category LinkedHashEntry */
class HashEntry
creator */
HashEntry(String key, int value)
price;
}
}

/* category HashTable */
class HashTable
non-public int TABLE_SIZE;
non-public int size;
non-public HashEntry[] table;
non-public int primeSize;

/* builder */
public HashTable(int ts)

/* perform to urge prime quantity but table size for myhash2 perform */
public int getPrime()
reality = 0;
for (int j = 2; j <= (int) scientific discipline.sqrt(i); j++)
if (i forward == 0)
fact++;
if (fact == 0)
return i;
}
/* come back a main range */
return 3;
}
/* perform to urge range of key-value pairs */
public int getSize()
{
come back size;
}
public Boolean isEmpty()
{
come back size == 0;
}
/* perform to clear hash table */
public void makeEmpty()
  
/* perform to urge worth of a key */
public int get(String key)
whereas (table[hash1] != null && !table[hash1].key.equals(key))
  
come back table[hash1].value;
}
/* perform to insert a key worth combine */
public void insert(String key, int value)
  
table[hash1] = new HashEntry(key, value);
size++;
}
/* perform to get rid of a key */
public void remove(String key)
{
int hash1 = myhash1( key );
int hash2 = myhash2( key );
whereas (table[hash1] != null && !table[hash1].key.equals(key))
  
table[hash1] = null;
size--;
}
/* perform myhash which provides a hash worth for a given string */
non-public int myhash1(String x )
{
int hashVal = x.hashCode( );
hashVal %= TABLE_SIZE;
if (hashVal < 0)
hashVal += TABLE_SIZE;
come back hashVal;
}
/* perform myhash perform for double hashing */
non-public int myhash2(String x )
{
int hashVal = x.hashCode( );
hashVal %= TABLE_SIZE;
if (hashVal < 0)
hashVal += TABLE_SIZE;
come back primeSize - hashVal the troubles primeSize;
}
/* perform to print hash table */
public void printHashTable()
  

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote