Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.ArrayList;
- public class Employee {
- private ArrayList names = new ArrayList(3);
- private double hourlySalary, monthlySalary, hours;
- public Employee(ArrayList name, double hourlySalary, double monthlySalary, int hours){
- this.names = name;
- this.hourlySalary = hourlySalary;
- this.monthlySalary = monthlySalary;
- this.hours = hours;
- }
- public double gethourlySalary(int hours){
- if(hours > 8)
- hourlySalary = 8 * hourlySalary + (hours-8) * 1.5;
- return hourlySalary;
- }
- public double getmonthlySalary(){
- return monthlySalary;
- }
- }
- import java.util.ArrayList;
- public class Company {
- private ArrayList <Employee> employeeList = new ArrayList();
- public Company(Employee...e){
- for(int i=0; i<e.length; i++)
- employeeList.add(e[i]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement