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

Assignment: Write a java class(es) with methods to manage employment for a small

ID: 3582328 • Letter: A

Question

Assignment: 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

Explanation / Answer

package bakery;
class BakeryEmployee
{
String empname;
int empid;
double empsalary;
int hoursWorked,shiftCount,shiftMinCount;
String shift1,shift2,shift3;
public BakeryEmployee()
{
hoursWorked=0;
shift1="day";
shift2="night";
shiftCount=1;
shift3=null;
shiftMinCount=0;
}

public BakeryEmployee(String empname, int empid, double empsalary) {
this.empname = empname;
this.empid = empid;
this.empsalary = empsalary;
}
public static BakeryEmployee addEmp()
{
return new BakeryEmployee();
}
public int timeCardCheck()
{
return hoursWorked;
}
public void timeCardAdd(int hours)
{
hoursWorked=hours;
}
public int timeCardTotal()
{
return hoursWorked;
}
public int empShifts()
{
return shiftCount;
}
public String emptyShifts()
{
return shift1;
}
public void shiftAdd()
{
shift3="Noon";
}
public int shiftMin(int count)
{
shiftMinCount=count;
return shiftMinCount;
}
}
public class Container
{
public static void main(String[] args)
{
System.out.println("Adding employees");
BakeryEmployee be1,be2,be3;
be1=BakeryEmployee.addEmp();
be2=BakeryEmployee.addEmp();
be3=BakeryEmployee.addEmp();
System.out.println("Number of hours worked by employee="+be1.hoursWorked);
//The remaining methods also can be called
}
  
}

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