ObjectOriented Assignment THANK YOU I need help doing the fo

Object-Oriented Assignment (THANK YOU!!)

I need help doing the following classes:

- Janitor.java

- FloorAssociate.java (assist customer and stock shelf\'s)

- CartStacker.java

- MyStore.java

I will also be including the following below: Person.java, StoreEmployee.java, SalesAssociate.java, and Manager.java

Instructions

In the object oriented General Store we have following Classes

Person

StoreEmployee

SalesAssociate

Manager

Janitor

FloorAssociate(assist customer and stock shelf\'s)

CartStacker

Person, Manager, FloorAssociate and StoreEmployee classes are already provided in sample code. Build additional classes based on following inheritance hierarchy.

Each type of employee in the General Store extends at least a common base class (StoreEmployee). A specialized type of one of the Employee types already existing in the System will extend as appropriate.

Write a specialized FloorAssoicate class called SalesAssociate to accompany other employees. SalesAssociate are experienced staff, they make 30% more money than a FloorAssociate and they get 1 additional vacation day.

SalesAssociate have to fill out cash position report at the beginning and end of their daily work: that is they have a specialized method getCashPosition() which should return

Write a StoreEmployee class Janitor to accompany other employees. Janitor work twice as many hours (80 hours/week), they make $10,000 less than general employees i.e. 20K, they get half as much vacation (i.e 5 days), and they have an additional method named clean() that prints \"Working for the General Store.\"

Write a StoreEmployee class CartStacker to accompany other employees. CartStacker are regular staff, they make 5% more money than a regular employee, they get same vacation days as general employees, and they have to work 5 more hours than a regular employee. They have to fill out 3 vacation slips in order to get a vacation. So their getVacationForm() method should return “YellowYellowYellow”. Note: If the parent class’s vacation slips color changes, it should also be reflected in this class.

CartStacker’s getTheCartsInOrder () method should return \"Move-in! Move-in!”

Any changes to a base class should get reflected accordingly. (Example: Store employee-wide policy change to update Base Salary or vacation days or Store location for all the employees)

Create MyStore.java file to test your code and put appropriate testing code for each objects

Total Possible Points: 75

Draw a basic inheritance diagram with Class name, variables and methods that shows the inheritance relationships between the above 7 classes – 10 points (Submit as pdf or jpeg on github)

Program runs as submitted - 5 points

Design SalesAssociate Class to meet the requirements as described above – 10 points

Design Janitor Class to meet the requirements as described above – 10 points

Design CartStacker Class to meet the requirements as described above – 10 points

Write a MyStore Class to invoke the behavior of the specific Employees using their instances as asked below:

Print the salary, hours and vacation form of a SalesAssociate. Also invoke SalesAssociate specific behavior method – 10 points

Print the salary, hours and vacation days of a Janitor. Also invoke Janitor specific behavior method – 10 points

Print the salary, hours and vacation days of a CartStacker. Also print the vacation form of the CartStacker making sure it satisfies the condition mentioned in the design of the CartStacker class – 10 points

------------------------------

StoreEmployee.java

------------------------------

// A class to represent behavior common to all type of General Store employees.

public class StoreEmployee extends Person{
  
   private String employeeId;
  
  
   /**
   * Takes
   * @param firstName
   * @param lastName
   * @param employeeId
   */
         
   public StoreEmployee(String firstName, String lastName, String employeeId) {
       super(firstName, lastName);
       this.employeeId=employeeId;
      
   }
  
  
   public String getEmployeeId() {
       return employeeId;
   }


   public int getHours() {
return 40; // Standard employee works 40 hours / week
}

public double getSalary() {
return 30000.0; // Base Salary of $30,000.00 / year
}

public int getVacationDays() {
return 10; // Base Vacation - 2 weeks
}

public String getVacationForm() {
return \"yellow\"; // use the yellow vacation slip
}
public String getStoreLocation() {
   return \"Rutgers Campus, New Brunswick, NJ\";//address of the store where all the employee works for this store
}
}

------------------------------------

Person.java

------------------------------

public abstract class Person {
private String firstName;
private String lastName;


public Person(String firstName, String lastName) {
   super();
   this.firstName = firstName;
   this.lastName = lastName;
}
public String getFirstName() {
   return firstName;
}
public void setFirstName(String firstName) {
   this.firstName = firstName;
}
public String getLastName() {
   return lastName;
}
public void setLastName(String lastName) {
   this.lastName = lastName;
}

}

---------------------------

Manager.java

-----------------------

import java.util.Date;
import java.text.DateFormat;
import java.text.SimpleDateFormat;


// A class to represent GeneralStore Manager.

public class Manager extends StoreEmployee {

   // Constructor
public Manager(String firstName, String lastName, String employeeId) {
       super(firstName, lastName, employeeId);
   }

       public void monitorEmployees() {
   System.out.println(\"Monitoring Empoyees work! Great Job! Keep it going!\");
}
  
public void assignWork(StoreEmployee employee) {
               DateFormat dateFormat = new SimpleDateFormat(\"yyyy/MM/dd HH:mm:ss\");
               Date date = new Date();
               System.out.println(dateFormat.format(date));
       System.out.println(\"Assigning Work to: Associate Name:\" + employee.getFirstName() + \" \" +employee.getLastName() + \" Associate Employee ID:\" + employee.getEmployeeId() + \" @ \" + dateFormat.format(date));
}

}

--------------------------------------

FloorAssociate.java

------------------------------------


public class FloorAssociate extends StoreEmployee {

// Constructor
   public FloorAssociate(String firstName, String lastName, String employeeId) {
       super(firstName, lastName, employeeId);
   }
   /**
   * Identify yourself and approach Customers Politely
   * @return
   */
  
   public String assistCustomers(){
       return \"This is \" + getFirstName() + \". How may I help you?\";
   }
  
   /**
   * Stack the shelves where necessary/
   */
   public void stockShelves(){
       System.out.println(\"Empty? Load it up!\");
   }
  
   @Override
   public double getSalary() {
      
       return super.getSalary() + 10000;//$10,000 more than general employee
   }

}

------------------------

Solution

--------------------------------------

SalesAssociate.java

------------------------------------

import java.util.Date;

public class SalesAssociate extends FloorAssociate {

   public SalesAssociate(String firstName, String lastName, String employeeId) {
       super(firstName, lastName, employeeId);
       // TODO Auto-generated constructor stub
   }
  
   @Override
   public double getSalary() {
       // TODO Auto-generated method stub
       return super.getSalary()+(0.3*super.getSalary());
   }
  
   @Override
   public int getVacationDays() {
       // TODO Auto-generated method stub
       return super.getVacationDays()+1;
   }
  
   public String getCashPosition() {
       return \"Store Location:\"+getStoreLocation()+\"\ Employee ID:\"+getEmployeeId()+\"\ Cash position:$\"+10+\"\ Time Stamp:\"+(new Date());
   }
}

--------------------------

Janitor.java

-------------------------

public class Janitor extends StoreEmployee {

   public Janitor(String firstName, String lastName, String employeeId) {
       super(firstName, lastName, employeeId);
       // TODO Auto-generated constructor stub
   }

   @Override
   public int getHours() {
       // TODO Auto-generated method stub
       return 2*super.getHours();
   }
  
   @Override
   public double getSalary() {
       // TODO Auto-generated method stub
       return super.getSalary()-10000;
   }
  
   @Override
   public int getVacationDays() {
       // TODO Auto-generated method stub
       return super.getVacationDays()/2;
   }
  
   public void clean() {
       System.out.println(\"Working for the General Store.\");
   }
}

-------------------------------

CartStacker.java

--------------------------------

public class CartStacker extends StoreEmployee {

   public CartStacker(String firstName, String lastName, String employeeId) {
       super(firstName, lastName, employeeId);
       // TODO Auto-generated constructor stub
   }

   @Override
   public double getSalary() {
       // TODO Auto-generated method stub
       return super.getSalary()+(0.05*super.getSalary());
   }
  
   @Override
   public int getHours() {
       // TODO Auto-generated method stub
       return super.getHours()+5;
   }
   @Override
   public String getVacationForm() {
       // TODO Auto-generated method stub
       return super.getVacationForm()+\"\"+super.getVacationForm()+\"\"+super.getVacationForm();
   }
  
   public String getTheCartsInOrder() {
       return \"Move-in! Move-in!\";
   }
}

------------------------

MyStore.java

---------------------

public class MyStore {

   public static void main(String[] args) {
       // TODO Auto-generated method stub
       System.out.println(\"\ \ ********** SALESASSOCIATES Object *********\");
       SalesAssociate s1=new SalesAssociate(\"Jon\", \"Shaw\", \"12003\");
       System.out.println(\"Salary:\"+s1.getSalary());
       System.out.println(\"Hours:\"+s1.getHours());
       System.out.println(\"Vacation Form:\"+s1.getVacationForm());
       System.out.println(s1.getCashPosition());
      
       System.out.println(\"\ \ ********** JANITOR Object *********\");
       Janitor j1=new Janitor(\"Kole\", \"M\", \"1245\");
       System.out.println(\"Salary:\"+j1.getSalary());
       System.out.println(\"Hours:\"+j1.getHours());
       System.out.println(\"Vacation Days:\"+j1.getVacationDays());
       j1.clean();
      
       System.out.println(\"\ \ ********** CARTSTACKER Object *********\");
       CartStacker c1=new CartStacker(\"P\", \"Paul\", \"58654\");
       System.out.println(\"Salary:\"+c1.getSalary());
       System.out.println(\"Hours:\"+c1.getHours());
       System.out.println(\"Vacation Days:\"+c1.getVacationDays());
       System.out.println(\"Vacation Form:\"+c1.getVacationForm());
      
   }

}

OUTPUT:

********** SALESASSOCIATES Object *********
Salary:52000.0
Hours:40
Vacation Form:yellow
Store Location:Rutgers Campus, New Brunswick, NJ
Employee ID:12003
Cash position:$10
Time Stamp:Wed Nov 09 17:27:54 IST 2016


********** JANITOR Object *********
Salary:20000.0
Hours:80
Vacation Days:5
Working for the General Store.


********** CARTSTACKER Object *********
Salary:31500.0
Hours:45
Vacation Days:10
Vacation Form:yellowyellowyellow

Object-Oriented Assignment (THANK YOU!!) I need help doing the following classes: - Janitor.java - FloorAssociate.java (assist customer and stock shelf\'s) - Ca
Object-Oriented Assignment (THANK YOU!!) I need help doing the following classes: - Janitor.java - FloorAssociate.java (assist customer and stock shelf\'s) - Ca
Object-Oriented Assignment (THANK YOU!!) I need help doing the following classes: - Janitor.java - FloorAssociate.java (assist customer and stock shelf\'s) - Ca
Object-Oriented Assignment (THANK YOU!!) I need help doing the following classes: - Janitor.java - FloorAssociate.java (assist customer and stock shelf\'s) - Ca
Object-Oriented Assignment (THANK YOU!!) I need help doing the following classes: - Janitor.java - FloorAssociate.java (assist customer and stock shelf\'s) - Ca
Object-Oriented Assignment (THANK YOU!!) I need help doing the following classes: - Janitor.java - FloorAssociate.java (assist customer and stock shelf\'s) - Ca
Object-Oriented Assignment (THANK YOU!!) I need help doing the following classes: - Janitor.java - FloorAssociate.java (assist customer and stock shelf\'s) - Ca

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site