Assume two arrays, one of student records, the other of employee records. Each student record contains for a last name, first name, and grade index. Each employee record contains members for a last name, first name and salary. Both arrays are ordered in alphabetical order by last name and first name. Two records with the same last name/ first name do not appear in the same array. write a java method to five a 10 percent raise to every employee who has a student record and whose grade point index is higher than 3.0. b. Write a method as in the preceding exercise, but assume that the employee and student records are kept in a vector rather than two ordered arrays.
Explanation / Answer
I did this using vector earlier hope you remember........ now i am doing it with array only...... you have to make only few changes in Raise Salary class. Employee and Student class will be same --------------------------------------- RaiseSalary Class ----------------------------------- package demo; import java.util.Scanner; import java.util.Vector; public class RaiseSalary { Employee[] employeeList=new Employee[2]; Student[] studentList=new Student[2]; Scanner scan=new Scanner(System.in); public void getEmployee() { String firstName; String lastName; Double salary; //lets take input for 5 employee for(int i=0;i