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

Program Description: This is an Employee Information system, intended for the us

ID: 3867886 • Letter: P

Question

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

I need help. please can some write this code.


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

import java.util.ArrayList;
import java.util.Scanner;

public class EmployeeClientoperations {
   ArrayList<BasicInfo> al = new ArrayList<BasicInfo>();

   public void addEmployee(BasicInfo p) {
       al.add(p);
   }

   public void deleteEmployee(int id) {
       if (al.size() > 0) {
           for (int i = 0; i < al.size(); i++) {
               if (al.get(i).getId() == id) {
                   al.remove(i);
               }

           }
       }
   }

   public BasicInfo searchEmployee(int id) throws Exception {
       if (al.size() > 0) {
           for (int i = 0; i < al.size(); i++) {
               if (al.get(i).getId() == id) {
                   return al.get(i);
               }
               else
               {
                   throw new Exception("The Id is not found");
               }

           }
      
       }
       return null;
  
   }

   public ArrayList<BasicInfo> displayEmployeeList() {
       return al;
   }
}

class HoursAndSalary
{
    float salary;
    int des;
    HoursAndSalary ()
    {
        System.out.println("Enter Designation:");
        des = get.nextInt();
        System.out.println("Enter Salary:");
        salary = get.nextFloat();
    }
    void display()
    {
        System.out.println("=============================="+" "+"Full Time BasicInfo Details"+" "+"=============================="+" ");
        super.display();
        System.out.println("Salary: "+salary);
        System.out.println("Designation: "+des);
    }
}

class SalaryCalc extends HoursAndSalary
{
    int workinghrs, rate;
    SalaryCalc ()
    {
        System.out.println("Enter Number of Working Hours:");
        workinghrs = get.nextInt();
    }
    void SalaryCalculation()
    {
        rate = 8 * workinghrs;
    }

    void display()
    {
        System.out.println("=============================="+" "+"Part Time BasicInfo Details"+" "+"=============================="+" ");
        super.display();
        System.out.println("Number of Working Hours: "+workinghrs);
        System.out.println("Salary for "+workinghrs+" working hours is: $"+rate);
    }
}
class EmployeeClient {
   public static void main(String args[]) throws Exception {

       EmployeeClientoperations pm = new EmployeeClientoperations();
       int choice;
       do {
           Scanner sc = new Scanner(System.in);
           System.out.println("enter choice:");
           choice = sc.nextInt();
           switch (choice) {
           case 1:
               System.out.println("add employeedetails:");
               System.out.println("enter id:");
               int id = sc.nextInt();
               System.out.println("enter firstname:");
               String firstname = sc.next();
               System.out.println("enter lastname:");
               String lastname = sc.next();
               System.out.println("enter address:");
               String address = sc.next();
               System.out.println("enter emailAddress:");
               String emailAddress = sc.next();
               System.out.println("enter postiontitle:");
               String postiontitle = sc.next();
               System.out.println("Enter phonenumber:");
               int phonenumber = sc.nextInt();
          
               pm.addEmployee(newEmployee(id,firstname,lastname,address,emailAddress,postiontitle,phonenumber));
               break;
           case 2:
               System.out.println("Searchemployee:");
               System.out.println("enter Employee id:");
               id = sc.nextInt();
               Employee p = pm.searchEmployee(id);
               System.out.println(p.toString());
               break;
           case 3:
               System.out.println("delete Employee:");
               System.out.println("enter Employee id:");
               id = sc.nextInt();
               pm.deleteEmployee(id);
               break;
           case 4:
               System.out.println("Display Employees:");
               ArrayList<BasicInfo> al = pm.displayEmployeeList();
               if (al.size() > 0) {
                   for (BasicInfo p1 : al) {
                       System.out.println(p1.toString());

                   }
               } else {
                   System.out.println("no Employees available");
               }

               break;
           default:
               System.out.println("invalid choice");
           }
       } while (choice > 0);

   }
   System.out.println("================================"+" "+"Enter Full Time BasicInfo Details"+" "+"================================"+" ");
     HoursAndSalary ob1 = new HoursAndSalary();
     SalaryCalc   ob = new SalaryCalc ();
     System.out.println("================================"+" "+"Enter Part Time BasicInfo Details"+" "+"================================"+" ");
     ob.SalaryCalculation();
   
}
}

class BasicInfo {
   private int id;
   private String firstname;
   private String lastname;
   private String address;
   private String emailAddress;
   private String postiontitle;
   private String Departname;
   private int phonenumber;

  

   public BasicInfo(int id, String firstname, String lastname, String address, String emailAddress,
           String postiontitle, String departname, int phonenumber) {
       super();
       GenerateID random ;
       ID=random.GenerateID();
       this.firstname = firstname;
       this.lastname = lastname;
       this.address = address;
       this.emailAddress = emailAddress;
       this.postiontitle = postiontitle;
       Departname = departname;
       this.phonenumber = phonenumber;
   }

   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 String getAddress() {
       return address;
   }

   public void setAddress(String address) {
       this.address = address;
   }

   public String getEmailAddress() {
       return emailAddress;
   }

   public void setEmailAddress(String emailAddress) {
       this.emailAddress = emailAddress;
   }


   public int getPhonenumber() {
       return phonenumber;
   }

   public void setPhonenumber(int phonenumber) {
       this.phonenumber = phonenumber;
   }

   public int getId() {
       return id;
   }

   public String getfirstname() {
       return firstname;
   }

   public void setfirstname(String firstname) {
       this.firstname = firstname;
   }



   public int getphonenumber() {
       return phonenumber;
   }

   public void setphonenumber(int phonenumber) {
       this.phonenumber = phonenumber;
   }

   public void setId(int id) {
       this.id = id;
   }

   @Override
   public String toString() {
       return "BasicInfo [id=" + id + ", firstname=" + firstname + ", lastname=" + lastname + ", address="
               + address + ", emailAddress=" + emailAddress + ", postiontitle=" + postiontitle
               + ", Departname=" + Departname + ", phonenumber=" + phonenumber + "]";
   }
}

class GenerateID
{
System.out.println("***** Generating Random Number of 4 digit *****");
for(int i=0;i<100;i++){
    long fraction = (long)(1000 * random.nextDouble());
    int id= (int)(fraction + 1000);
    System.out.println(id);
}
}

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