I need help for my next project due next tuesday can you hel

I need help for my next project due next tuesday can you help me in writing this program and can you make it a simple program easy as possible.

note here are the parameters of the program in bold:

Design a class named Employee. The class should keep the following information in fields:

• Employee name

• Employee number in the format XXX–L, where each X is a digit within the range 0–9

and the L is a letter within the range A–M.

• Hire date

Write one or more constructors and the appropriate accessor and mutator methods for the class.

Next, write a class named Production Worker that extends the Employee class. The

Production Worker class should have fields to hold the following information:

• Shift (an integer)

• Hourly pay rate (a double)

The workday is divided into two shifts: day and night. The shift field will be an integer value

representing the shift that the employee works. The day shift is shift 1 and the night shift is

shift 2. Write one or more constructors and the appropriate accessor and mutator methods for

the class. Demonstrate the classes by writing a program that uses a Production Worker object. Each class needs a no-arg constructor and a constructor that initializes all fields with data (The Production Worker class constructor should receive data for the Employee class fields as well) Create a method within the Employee and Production Worker classes called display Info. (display Info accepts no arguments and returns void) To display the data for each constructor, the demonstration class will call the subclass display Info method and it will call the superclass display Info method. User input is not required for the demonstration class.

Solution

Employe class:

public class Employee

{

public String name;

public String number;

public String hireDate;

public Employee(String n, String num, String hd)

{

name = n;

number = num;

hireDate = hd;

}

public String getName() {

return name;

}

public String getNumber()

{

return number;

}

public String getHireDate()

{

return hireDate;

}

private boolean isValidEmpNum(String e)

{

boolean isValid = true;

int i = 0;

if (e.length() != 5)

{

isValid = false;

}

while (isValid && i < 3)

{

if (!Character.isDigit(e.charAt(i)))

{

isValid = false;

}

i++;

}

while (isValid && i < 4)

{

if (e.charAt(i) != \'-\')

{

isValid = false;

}

i++;

}

while (isValid && i < 5)

{

if (!Character.isLetter(e.charAt(i)))

{

isValid = false;

}

i++;

}

while (isValid && i < 6)

{

if (e.charAt(4) <= \'A\' || e.charAt(4) >= \'M\')

{

isValid = false;

}

i++;

}

return isValid;

}

@Override

public String toString()

{

String str = \"Name: \" + name + \"\ Employee Number: \";

if (\"\".equals(number))

{

str += \"Invalid Employee Number\";

}

else {

str += number;

}

str += (\"\ Hire Date: \" + hireDate);

return str;

}

}


productionworker class:

import java.text.DecimalFormat;

public class ProductionWorker extends Employee

{

public static int dayShift = 1;

public static int nightShift = 2;

private int shift;

private double payRate;

public String getShift()

{

String shiftTime;

if (shift == 1)

{

shiftTime = \"Day\";

}

else if (shift == 2)

{

shiftTime = \"Night\";

}

else if (shift == 3)

{

shiftTime = \"Alternating\";

}

Else {

shiftTime = \"On Call\";

}

return shiftTime;

}

public void setShift(int s)

{

shift = s;

}

public double getPayRate()

{

return payRate;

}

public void setPayRate(double rate)

{

payRate = rate;

}

public ProductionWorker(String n, String num, String hd, int sh, double rate) {

super(n, num, hd);

shift = sh;

payRate = rate;

}

public ProductionWorker(String n, String num, String hd) {

super(n, num, hd);

shift = dayShift;

payRate = 0.0;

}

@Override

public String toString()

{

DecimalFormat dollar = new DecimalFormat(\"#,##0.00\");

String str = super.toString();

str += \"\ Shift: \";

if (shift == dayShift)

{

str += \"Day\";

}

else if (shift == nightShift)

{

str += \"Night\";

}

else {

str += \"Invalid Shift Number\";

}

str += (\"\ Hourly Pay Rate: $\"+ dollar.format(payRate));

return str;

}

}


workdemo class:

import javax.swing.JOptionPane;

public class WorkDemo

{

public static void main(String[] args)

{

String name;

String number;

String hireDate;

int shift;

double payRate;

double monthlyBonus;

double requiredTrainingHours;

double trainingHoursAttended;

name = JOptionPane.showInputDialog(\"Enter your name\");

number = JOptionPane.showInputDialog(\"Enter your number (Format: XXX-L)\");

hireDate = JOptionPane.showInputDialog(\"Enter your hire date\");

shift = Integer.parseInt(JOptionPane.showInputDialog(\"Please enter the work shift for the employee:\ \"

+ \"\\tEnter 1 for the day shift\ \\tEnter 2 for the night shift\"));

payRate = Double.parseDouble(JOptionPane.showInputDialog(\"Enter your pay rate\"));

monthlyBonus = Double.parseDouble(JOptionPane.showInputDialog(\"Enter your monthly bonus\"));

requiredTrainingHours = Double.parseDouble(JOptionPane.showInputDialog(\"Enter your required traing hours\"));

trainingHoursAttended = Double.parseDouble(JOptionPane.showInputDialog(\"Enter your training hours attended\"));

TeamLeader pw = new TeamLeader(name, number,

hireDate, shift, payRate, monthlyBonus, requiredTrainingHours, trainingHoursAttended);

JOptionPane.showMessageDialog(null,+ \"\ Name: \"+ pw.getName() + \" .\ Employee Number: \"

+ pw.getNumber() + \"\ Hire Date: \"+ pw.getHireDate() + \"\ Pay Rate: \"+ pw.getPayRate() + \"\ Shift: \"

+ pw.getShift() + \"\ Monthly Bonus: \"+ pw.getMonthlyBonus() + \"\ Required Training Hours: \"

+ pw.getRequiredTrainingHours() + \"\ Training Hours Attended: \"+ pw.getTrainingHoursAttended());

System.exit(0);

}

}

I need help for my next project due next tuesday can you help me in writing this program and can you make it a simple program easy as possible. note here are th
I need help for my next project due next tuesday can you help me in writing this program and can you make it a simple program easy as possible. note here are th
I need help for my next project due next tuesday can you help me in writing this program and can you make it a simple program easy as possible. note here are th
I need help for my next project due next tuesday can you help me in writing this program and can you make it a simple program easy as possible. note here are th
I need help for my next project due next tuesday can you help me in writing this program and can you make it a simple program easy as possible. note here are th
I need help for my next project due next tuesday can you help me in writing this program and can you make it a simple program easy as possible. note here are th
I need help for my next project due next tuesday can you help me in writing this program and can you make it a simple program easy as possible. note here are th

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site