代写C代码 代做C程序 C辅导 C家教

远程写代码 Debug 讲解答疑 不是中介,本人直接写

微信: ittutor QQ: 14061936 Email: ittutor@qq.com

导航

An employer may have more than one employee and each employee has hiring date beside basic information such as firs name, last name, address, phone number etc. In order to create an employer we need to define an employee first. Employee consists of the following information:

      

       String First name

       String Last name

       Date of birth (DoB)

       Date of hiring (DoH)

       double Gross salary

 

In order to define an employee, we first need to define a date class with the following information:

 

       int month  //numbers between 1-12

       int day( between 1-31)

       int year(1900-..) //4-digit number starting from 1900

 

Now we are ready to create an employer with the following information:

 

       String name //name of the employer such as WKU, GM, etc.

       Array of employee

       double GrossYearlyEarning

       String address //employer address

 

 

 

 

 

 

 

You need to write a program that creates an array of employer (size is at least 5) each of which will have at least 10 employee. Determine the following:

 

1)      Print the list of employees sorted by last name as follows:

Employee name:

   Employer 1

   Employer 2

   ……     

2)      Highest paid employee in each employer

3)      Most senior employee in each employer

4)      Employer with the highest yearly earnings

 

Example:

 

Suppose we have the following employers

 

Employer name:  WKU

 

Employees:

       Isaac                 Files              DoB:05/03/1973    DoH:12/12/1993      67.200

       Mustafa        Atici          DoB:05/05/1970   DoH:12/03/1998        56,000

       Jason           Barnes              DoB:03/03/1970    DoH:03/04/1990      72,789

       Shanna Brocman         DoB:02/02/1971    DoH:02/03/1992    100,098

       Chris           Clark              DoB:12/04/1972    DoH:11/03/1993      43,980

      

Address:  1906 college height blvd, Bowling Green, KY, 42103

 

Gross yearly earnings:  $1,456,300

 

 

Name of employer: Time Warner Cable

 

Employees:

 

       Adam         Lester        DoB: 02/04/1987      DoH:11/02/2001       75,000

       Jamielle    Gummer   DoB: 11/04/1972      DoH:10/12/1995   67,980

       Gabrile     Kirtley         DoB: 10/10/1980      DoH:02/03/2000   34,800

       Clinton     Knight         DoB: 05/03/1983      DoH:01/01/1997   98,455

      

Address: 451 Three spring road, Bowling Green, KY, 42101

 

Gross yearly earnings: $4,567,100

 

 

 

 

Based on this information, your program should give the following output:

 

Employer: WKU

Employees:

   Mustafa        Atici            DoB:05/05/1970    DoH:12/03/1998      56,000

  Jason              Barnes              DoB:03/03/1970    DoH:03/04/1990      72,789

  Shanna    Brocman         DoB:02/02/1971    DoH:02/03/1992    100,098

  Chris              Clark             DoB:12/04/1972    DoH:11/03/1993      43,980

  Isaac      Files              DoB:05/03/1973    DoH:12/12/1993      67.200

 

Highest paid employee:

       Shanna  Brocman,  with salary 100,098

Most senior employee:

       Shanna Brocman, started at   03/04/1990

 

Employer: Time Warner Cable

Employees:

  Jamielle    Gummer       DoB: 11/04/1972      DoH:10/12/1995   67,980

  Gabrile     Kirtley            DoB: 10/10/1980      DoH:02/03/2000   34,800

  Clinton     Knight            DoB: 05/03/1983      DoH:01/01/1997   98,455

  Adam        Lester                  DoB: 02/04/1987      DoH:11/02/2001    75,000

 

Highest paid employee:

       Clinton     Knight, with salary 98,455

Most senior employee:

       Jamielle Gummer, started at   10/12/1995

 

Employer with maximum earnings: Time Warner Cable.

 

 

 

Suggested methods in each class:

 

Date:

       Constructors

       Set and get methods

       toString

       reverse that reverses Date object to find most senior employee

       compare: methods that compares two dates object to check which one is smaller(or bigger, equal)

 

 

 

 

 

Employee:

       Constructors

       Set and get methods

       toString method to print an employee in the form of

 

       FirstName    LastName     DoB      DoH      salary

 

Employer:

       Constructors

       Set and get methods

       MaxSalaried: method that returns employee with maximum salary

       MostSenior: method that returns employee with minimum hiring date

       Sort: sorts the employee list with respect to last name

       toString method

 

Test:

       main

       randomFirst: method returns a name

       randomLast: method returns a last name

       randomDate: method return a Date

       MaxEarning: method that determines employer with maximum yearly earning

相关推荐