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

Problem Description: Develop a tool to keep track of a company’s Employees. The

ID: 3672395 • Letter: P

Question

Problem Description:

Develop a tool to keep track of a company’s Employees. The Employee Management Prototype will be able to add employees, calculate the weekly payroll and the associated taxes, view employees and their employment data, and determine which employee has been employed at the Company for the longest period. Each employee’s data will be stored in an Employee array (set maximum size for now to be 10). Every employee will have a name, a start employment date (day, month, year) a weekly pay amount and a weekly tax amount. All date input entered from the keyboard must be fully edited for valid data – you can create an OurDate class to do validation.

ALL INFORMATION YOU NEED TO SOLVE THIS ASSIGNMENT ARE FIND IN THIS LINK BELLOW, SO PLEASE DOWNLOAD THE PDF FILE TO HAVE A LOOK:

http://www108.zippyshare.com/v/4GlaoGCX/file.html

PLEASE POST YOUR SOLUTION HERE OR AS A ZIP FILE IN THE SAME SERVICE ABOVE AND PROVIDE THE LINK.

THANKS ALL.

Explanation / Answer

Date.java

import java.util.*;

class Date {
   private int year;
   private int month;
   private int day;

   public Date () {
   }
   public Date (int year, int month, int day) {
       this.year = year;
       this.month = month;
       this.day = day;
   }
   public Date (Date date) {
       this.year = date.year;
       this.month = date.month;
       this.day = date.day;
   }

   public int getYear () { return year; }
   public int getMonth() { return month; }
   public int getDay()   { return day; }

   public void setYear (int year) {
       this.year = year;
   }
   public void setMonth (int month) {
       this.month = month;
   }
   public void setDay (int day) {
       this.day = day;
   }

   public String toString () {
       return " " + year + "/" + month + "/" + day;
   }
}

Employee.java
import java.util.*;
import java.util.Scanner;

class Employee {
    protected String name = new String();
    protected Date startDate= new Date();
    protected Date dateOfBirth = new Date();
    protected double weeklyPayAmount;
    protected double weeklyTaxAmount;
    protected Scanner in = new Scanner(System.in);

    public Employee () {
    }
    public Employee (String name, Date startDate, Date dateOfBirth, double weeklyPayAmount, double weeklyTaxAmount) {
   this.name = new String (name);
        this.startDate = new Date (startDate);
   this.dateOfBirth = new Date (dateOfBirth);
   this.weeklyPayAmount = weeklyPayAmount;
   this.weeklyTaxAmount = weeklyTaxAmount;
    }
    public Employee (Employee employee) {
   this.name = new String (employee.name);
        this.startDate = new Date (employee.startDate);
   this.dateOfBirth = new Date (employee.dateOfBirth);
   this.weeklyPayAmount = employee.weeklyPayAmount;
   this.weeklyTaxAmount = employee.weeklyTaxAmount;
    }

    public String getName () { return name; }
    public Date getStartDate() { return startDate; }
    public Date dateOfBirth() { return dateOfBirth; }
    public double getWeeklyPayAmount() { return weeklyPayAmount; }
    public double getWeeklyTaxAmount() { return weeklyTaxAmount; }

    public void setName (String name) {
   this.name = new String (name);
    }
    public void setStartDate (Date startDate) {
   this.startDate = new Date (startDate);
    }
    public void setDateOfBirth (Date dateOfBirth) {
   this.dateOfBirth = new Date (dateOfBirth);
    }
    public void setWeeklyPayAmount (double weeklyPayAmount) {
   this.weeklyPayAmount = weeklyPayAmount;
    }
    public void setWeeklyTaxAmount (double weeklyTaxAmount) {
   this.weeklyTaxAmount = weeklyTaxAmount;
    }


    public void calcWeeklyPayAmount() {
    }
    public void calcWeeklyTaxAmount() {
   if (weeklyPayAmount > 2000)
       weeklyTaxAmount = weeklyPayAmount * 0.3;
   else if (weeklyPayAmount < 1000)
       weeklyTaxAmount = 0;
   else    weeklyTaxAmount = weeklyPayAmount * 0.2;
    }

    public String toString () {
   return name + " Pay: $" + weeklyPayAmount + " Tax $" + weeklyTaxAmount;
    }
  
    public void setFromKeyboard() {
       weeklyPayAmount = 0;
       weeklyTaxAmount = 0;
      
       //Name
       System.out.print(" Please enter your name: ");
       name = in.nextLine();
      
      
       //Enter Birth Date
       System.out.print(" Enter birth date: Year: ");
       dateOfBirth.setYear(in.nextInt());
       do {
       System.out.print("Month: ");
       dateOfBirth.setMonth(in.nextInt());
       }while (dateOfBirth.getMonth() < 1 || dateOfBirth.getMonth() > 12);
       do {
       System.out.print("Day: ");
       dateOfBirth.setDay(in.nextInt());
       }while (dateOfBirth.getDay() < 1 || dateOfBirth.getDay() > 31);
      
       //Start Date
      
       do {
       System.out.print(" Enter start date: Year: ");
       startDate.setYear(in.nextInt());
       }while (startDate.getYear() < dateOfBirth.getYear());
       do {
       System.out.print("Month: ");
       startDate.setMonth(in.nextInt());
       }while (startDate.getMonth() < 1 || startDate.getMonth() > 12);
       do {
       System.out.print("Day: ");
       startDate.setDay(in.nextInt());
       }while (startDate.getDay() < 1 || startDate.getDay() > 31);
      
      
      
    }
}

Executive.java
class Executive extends Employee {
   protected double yearlySalary;

   public Executive () {
   }
   public Executive (String name, Date startDate, Date dateOfBirth, double weeklyPayAmount, double weeklyTaxAmount, double yearlySalary) {
      super(name, startDate, dateOfBirth, weeklyPayAmount, weeklyTaxAmount);
       this.yearlySalary = yearlySalary;
   }

   public double getYearlySalary () {return yearlySalary; }
   public void setYearlySalary (double yearlySalary) {
       this.yearlySalary = yearlySalary;
   }
  
   @Override
   public void calcWeeklyPayAmount() {
       this.weeklyPayAmount = yearlySalary / 52.0;
   }
  
   @Override
    public void setFromKeyboard() {
       weeklyPayAmount = 0;
       weeklyTaxAmount = 0;
      
       //Name
       System.out.print(" Please enter your name: ");
       name = in.nextLine();
      
       //Enter Birth Date
       System.out.print(" Enter birth date: Year: ");
       dateOfBirth.setYear(in.nextInt());
       do {
       System.out.print("Month: ");
       dateOfBirth.setMonth(in.nextInt());
       }while (dateOfBirth.getMonth() < 1 || dateOfBirth.getMonth() > 12);
       do {
       System.out.print("Day: ");
       dateOfBirth.setDay(in.nextInt());
       }while (dateOfBirth.getDay() < 1 || dateOfBirth.getDay() > 31);
      
       //Start Date
      
       do {
       System.out.print(" Enter start date: Year: ");
       startDate.setYear(in.nextInt());
       }while (startDate.getYear() < dateOfBirth.getYear());
       do {
       System.out.print("Month: ");
       startDate.setMonth(in.nextInt());
       }while (startDate.getMonth() < 1 || startDate.getMonth() > 12);
       do {
       System.out.print("Day: ");
       startDate.setDay(in.nextInt());
       }while (startDate.getDay() < 1 || startDate.getDay() > 31);
      
       //Yearly Salary
       System.out.print("Enter yearly salary: ");
       yearlySalary = in.nextDouble();
    }
      
}

Programmer.java
class Programmer extends Employee {
   protected double hoursWorked;
        protected double rateOfPay;

   public Programmer() {
   }
   public Programmer (String name, Date startDate, Date dateOfBirth, double weeklyPayAmount, double weeklyTaxAmount, double hoursWorked, double rateOfPay) {
      super(name, startDate, dateOfBirth, weeklyPayAmount, weeklyTaxAmount);
       this.hoursWorked = hoursWorked;
       this.rateOfPay = rateOfPay;
   }

   public double getHoursWorked () {return hoursWorked; }
   public double getTateOfPay() { return rateOfPay; }

   public void setHoursWorked (double hoursWorked) {
       this.hoursWorked = hoursWorked;
   }
   public void setTateOfPay (double rateOfPay) {
       this.rateOfPay = rateOfPay;
   }
  
   @Override
   public void calcWeeklyPayAmount() {
       if (hoursWorked < 40)
           this.weeklyPayAmount = this.hoursWorked * this.rateOfPay;
       else    this.weeklyPayAmount = ((this.hoursWorked-40) *1.5 + 40)* this.rateOfPay;
   }
  
   @Override
    public void setFromKeyboard() {
       weeklyPayAmount = 0;
       weeklyTaxAmount = 0;
      
       //Name
       System.out.print(" Please enter your name: ");
       name = in.nextLine();
      
       //Enter Birth Date
       System.out.print(" Enter birth date: Year: ");
       dateOfBirth.setYear(in.nextInt());
       do {
       System.out.print("Month: ");
       dateOfBirth.setMonth(in.nextInt());
       }while (dateOfBirth.getMonth() < 1 || dateOfBirth.getMonth() > 12);
       do {
       System.out.print("Day: ");
       dateOfBirth.setDay(in.nextInt());
       }while (dateOfBirth.getDay() < 1 || dateOfBirth.getDay() > 31);
      
       //Start Date
      
       do {
       System.out.print(" Enter start date: Year: ");
       startDate.setYear(in.nextInt());
       }while (startDate.getYear() < dateOfBirth.getYear());
       do {
       System.out.print("Month: ");
       startDate.setMonth(in.nextInt());
       }while (startDate.getMonth() < 1 || startDate.getMonth() > 12);
       do {
       System.out.print("Day: ");
       startDate.setDay(in.nextInt());
       }while (startDate.getDay() < 1 || startDate.getDay() > 31);
      
       //Hours Worked
       System.out.print("Enter hours worked: ");
       hoursWorked = in.nextInt();
      
       //Rate of Pay
       System.out.print("Enter hourly pay: ");
       rateOfPay = in.nextDouble();
    }
      
}

SalesRep.java

class Programmer extends Employee {
   protected double hoursWorked;
        protected double rateOfPay;

   public Programmer() {
   }
   public Programmer (String name, Date startDate, Date dateOfBirth, double weeklyPayAmount, double weeklyTaxAmount, double hoursWorked, double rateOfPay) {
      super(name, startDate, dateOfBirth, weeklyPayAmount, weeklyTaxAmount);
       this.hoursWorked = hoursWorked;
       this.rateOfPay = rateOfPay;
   }

   public double getHoursWorked () {return hoursWorked; }
   public double getTateOfPay() { return rateOfPay; }

   public void setHoursWorked (double hoursWorked) {
       this.hoursWorked = hoursWorked;
   }
   public void setTateOfPay (double rateOfPay) {
       this.rateOfPay = rateOfPay;
   }
  
   @Override
   public void calcWeeklyPayAmount() {
       if (hoursWorked < 40)
           this.weeklyPayAmount = this.hoursWorked * this.rateOfPay;
       else    this.weeklyPayAmount = ((this.hoursWorked-40) *1.5 + 40)* this.rateOfPay;
   }
  
   @Override
    public void setFromKeyboard() {
       weeklyPayAmount = 0;
       weeklyTaxAmount = 0;
      
       //Name
       System.out.print(" Please enter your name: ");
       name = in.nextLine();
      
       //Enter Birth Date
       System.out.print(" Enter birth date: Year: ");
       dateOfBirth.setYear(in.nextInt());
       do {
       System.out.print("Month: ");
       dateOfBirth.setMonth(in.nextInt());
       }while (dateOfBirth.getMonth() < 1 || dateOfBirth.getMonth() > 12);
       do {
       System.out.print("Day: ");
       dateOfBirth.setDay(in.nextInt());
       }while (dateOfBirth.getDay() < 1 || dateOfBirth.getDay() > 31);
      
       //Start Date
      
       do {
       System.out.print(" Enter start date: Year: ");
       startDate.setYear(in.nextInt());
       }while (startDate.getYear() < dateOfBirth.getYear());
       do {
       System.out.print("Month: ");
       startDate.setMonth(in.nextInt());
       }while (startDate.getMonth() < 1 || startDate.getMonth() > 12);
       do {
       System.out.print("Day: ");
       startDate.setDay(in.nextInt());
       }while (startDate.getDay() < 1 || startDate.getDay() > 31);
      
       //Hours Worked
       System.out.print("Enter hours worked: ");
       hoursWorked = in.nextInt();
      
       //Rate of Pay
       System.out.print("Enter hourly pay: ");
       rateOfPay = in.nextDouble();
    }
      
}


Test.java

class Programmer extends Employee {
   protected double hoursWorked;
        protected double rateOfPay;

   public Programmer() {
   }
   public Programmer (String name, Date startDate, Date dateOfBirth, double weeklyPayAmount, double weeklyTaxAmount, double hoursWorked, double rateOfPay) {
      super(name, startDate, dateOfBirth, weeklyPayAmount, weeklyTaxAmount);
       this.hoursWorked = hoursWorked;
       this.rateOfPay = rateOfPay;
   }

   public double getHoursWorked () {return hoursWorked; }
   public double getTateOfPay() { return rateOfPay; }

   public void setHoursWorked (double hoursWorked) {
       this.hoursWorked = hoursWorked;
   }
   public void setTateOfPay (double rateOfPay) {
       this.rateOfPay = rateOfPay;
   }
  
   @Override
   public void calcWeeklyPayAmount() {
       if (hoursWorked < 40)
           this.weeklyPayAmount = this.hoursWorked * this.rateOfPay;
       else    this.weeklyPayAmount = ((this.hoursWorked-40) *1.5 + 40)* this.rateOfPay;
   }
  
   @Override
    public void setFromKeyboard() {
       weeklyPayAmount = 0;
       weeklyTaxAmount = 0;
      
       //Name
       System.out.print(" Please enter your name: ");
       name = in.nextLine();
      
       //Enter Birth Date
       System.out.print(" Enter birth date: Year: ");
       dateOfBirth.setYear(in.nextInt());
       do {
       System.out.print("Month: ");
       dateOfBirth.setMonth(in.nextInt());
       }while (dateOfBirth.getMonth() < 1 || dateOfBirth.getMonth() > 12);
       do {
       System.out.print("Day: ");
       dateOfBirth.setDay(in.nextInt());
       }while (dateOfBirth.getDay() < 1 || dateOfBirth.getDay() > 31);
      
       //Start Date
      
       do {
       System.out.print(" Enter start date: Year: ");
       startDate.setYear(in.nextInt());
       }while (startDate.getYear() < dateOfBirth.getYear());
       do {
       System.out.print("Month: ");
       startDate.setMonth(in.nextInt());
       }while (startDate.getMonth() < 1 || startDate.getMonth() > 12);
       do {
       System.out.print("Day: ");
       startDate.setDay(in.nextInt());
       }while (startDate.getDay() < 1 || startDate.getDay() > 31);
      
       //Hours Worked
       System.out.print("Enter hours worked: ");
       hoursWorked = in.nextInt();
      
       //Rate of Pay
       System.out.print("Enter hourly pay: ");
       rateOfPay = in.nextDouble();
    }
      
}

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