I would greatly appreciate any help you can provide Thank yo
I would greatly appreciate any help you can provide. Thank you very much.
Write a java class(es) with methods to manage employment for a small bakery. All classes should have at least a null constructor and copy constructor. Other constructors would be up to your discretion. Include all necessary accessors and modifiers. To test your classes, create a Container class with simply a main() method. The Container class will have attributes that are class objects of each of the classes you create. The main() method will create the class objects, perform some normal business for that store, and produce appropriate output.
Possibilities:
-Add new employee and personal info
-Time Card Check – this method will check to see if the employee worked any hours this week
Time Card Add – this method will add hours to the employees time card.
Time Card Total – this method will return the total hours worked by an employee
Employee Shift – this method will assign employees to a number of shifts.
Empty Shifts – this method will determine if any shift is empty.
Shift Add – This will add an employee to a shift.
Shift Min – this method will set the minimum number of workers needed for a shift
Solution
public class Employee
{
public int empno;
public String name;
public String designation;
public double salary;
public int timeCardAdd;
public int timeCardTotal;
public int shifts;
public boolean isShiftEmpty;
// no arguments constructor
public Employee() {}
//parametrised constructor
public Employee(int n, String name, String des, double sal, int shifts, boolean ise) {
this.empno = n;
this.name = name;
this.designation = des;
this.salary = sal;
this.shifts = shifts;
this.isShiftEmpty = ise;
}
public void assignShift(int s) {
shifts = s;
}
public int calculateTimeCardTotal(boolean tcc, int tca, int tct) {
if(tcc == true)
return (tct + tca);
else
return tct;
}
public void addShift(int num, int min) {
if((isShiftEmpty) && (num >= min))
shifts++;
}
public static void main(String[] args) {
Employee emp = new Employee(100, \"John\", \"Manager\", 20000, 5, true);
emp.addShift(14,10);
int total = emp.calculateTimeCardTotal(true,20,30);
System.out.println(\"Total number of hours worked by \" +emp.name+ \" = \"+total);
}
}

