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

Java Think about how you might write a program to implement the system. Include

ID: 3779760 • Letter: J

Question

Java

Think about how you might write a program to implement the system. Include a comprehensive UML diagram for each class except the client. What are the instance variables and methods in classes? How do they relate? Describe the inheritance, composition, instance variables, static variable, static method. How would the application start? What does the system do? What inputs & outputs would there be? Design and write up an algorithm to describe how the program will run.

Program Description:

This is an Employee Information system, intended for the use of the manager or other administrative personal to store, edit, and re-access their Employees’ information. Simple budget and salary calculations will also be implemented. The following detailed program description contains the minimum program requirements. Students are encouraged to add more features (classes, Methods, etc...) after creating the initial classes and methods.

Implementation Requirements:

This program will include the fundamentals of object-oriented programing and all of the requirements for the final project, including:

Arrays or ArrayLists of objects

Static variables and methods

Method overriding (of the toString())

Composition

Inheritance

Random number generation

The storing, editing, and deleting of data using objects

String methods

Class Descriptions

Class Name: EmployeeClient

Class Description: Create a client class which displays the capabilities of the program. Creativity is encouraged. However, it MUST include the following:

Main should contain a loop, presenting a list of options at the start of each iteration.

Using an array or ArrayList, allow the user to add and delete Employees from the list.

Allow the user to search through the system for specific Employees. If the Employee is found, print their corresponding information.

GUI or console may be used.

Class Name: BasicInfo

Class Description: This class will have instance variables to store each Employee’s:

first name

last name

ID

the specific department they each work for

phone number

address

email address

position title

Include set and get methods for each variable. Include a toString() method which returns a formatted string of an Employee’s data from this class.

Class Name: GenerateID

Class Description: This class will have instance variables for each Employee’s:

Employee ID

position number

department

Variable department should be of type BasicInfo (Composition). Each Employee ID should be a randomly generated 4 digit number. Each position number should be a randomly generated 4 digit number, concatenated to the back of the abbreviation for the department (for example, if the department is Math, the position number should begin with the prefix MA, if English, then ENG, etc).

Include the appropriate methods for each instance variable. Include a toString() method which returns a formatted string notifying the user that a new Employee’s Employee ID and position number have been generated, and display this data.   

Class Name: HoursAndSalary

Class Description: this class will allow the administrator to edit:

The salary for the Employees. Note: all Employees receive the same salary.

The budget

The sum of the hours worked each week.

Include code to verify that the salary is above minimum wage, and that the budget and sum of hours are positive number.

Class Name: SalaryCalc

Class Description: this class is a subclass of HoursAndSalary (Inheritance). The variables and methods of this class are largely up to the programmer. However, it is strongly suggested that they be in some way pertaining to salary or budget. This class will:

Calculate the budget deficit or surplus.

Contain at least three instance variables and their corresponding methods.

Explanation / Answer

package com.employee.salary;

import java.util.ArrayList;
import java.util.List;

public class EmployeeClient {
  
   public static void main(String[] tt)
   {
       List department=new ArrayList();
       department.add("cse");
       department.add("it");
       GenerateID generateID=new GenerateID("Arun","Singh",department,"a@g.com","Manager");
       SalaryCalc salaryCalc=new SalaryCalc(10,2000);
       System.out.println(salaryCalc.calculateSalary(9));//calculate salary, enter hoursOfWork
   }

}


........................

package com.employee.salary;

import java.util.List;

public class BasicInfo {
  
   private String firstName;
   private String lastName;
   private Integer ID;
   private List department;
   private String email;
   private String positionTitle;
   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;
   }
   public Integer getID() {
       return ID;
   }
   public void setID(Integer iD) {
       ID = iD;
   }
   public List getDepartment() {
       return department;
   }
   public void setDepartment(List department) {
       this.department = department;
   }
   public String getEmail() {
       return email;
   }
   public void setEmail(String email) {
       this.email = email;
   }
   public String getPositionTitle() {
       return positionTitle;
   }
   public void setPositionTitle(String positionTitle) {
       this.positionTitle = positionTitle;
   }
  
   public String toString(){
       return positionTitle+" "+firstName+" "+lastName+" from department "+ department+" having emailId:" +email;
      
   }

}


.............................

package com.employee.salary;

import java.util.List;

public class GenerateID {
   private Long id;
   private String firstName;
   private String lastName;
   private Integer ID;
   private List department;
   private String email;
   private String positionTitle;
   public GenerateID(String firstName,String lastName,List department,String email,String positionTitle){
       id=System.currentTimeMillis()*10000;
       BasicInfo basicInfo=new BasicInfo();
       basicInfo.setID(((Number)id).intValue());
       basicInfo.setFirstName(firstName);
       basicInfo.setLastName(lastName);
       basicInfo.setDepartment(department);
       basicInfo.setEmail(email);
       basicInfo.setPositionTitle(positionTitle);
       System.out.println(basicInfo.toString());
      
   }

}


............................................

package com.employee.salary;

public class HoursAndSalary {
   private Integer hourlyWages;
   private Integer budget;
   private Integer minimumWages;
  
public HoursAndSalary(Integer hourlyWages, Integer budget){
   this.hourlyWages=hourlyWages;
   this.budget=budget;
   this.minimumWages=1000;//Dollars
}

public Integer getHourlyWages() {
   return hourlyWages;
}

public void setHourlyWages(Integer hourlyWages) {
   this.hourlyWages = hourlyWages;
}

public Integer getBudget() {
   return budget;
}

public void setBudget(Integer budget) {
   this.budget = budget;
}


}


...................................

package com.employee.salary;

public class SalaryCalc extends HoursAndSalary{
  
   public SalaryCalc(Integer hourlyWages, Integer budget){
      
       super(hourlyWages,budget);
   }
  
   public Double calculateSalary(int hoursOfWork)
   {
       Double salary=(double) (getHourlyWages()*hoursOfWork);
               if(salary<=getBudget())
                   return salary;
                   else
                   return 0.0;
      
   }

}

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