Advertisement
alexarcan

Paycheck problem

Dec 12th, 2014
411
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.82 KB | None | 0 0
  1. import java.util.ArrayList;
  2.  
  3.  
  4. public class Employee {
  5.    
  6.     private ArrayList names = new ArrayList(3);
  7.     private double hourlySalary, monthlySalary, hours;
  8.    
  9.     public Employee(ArrayList name, double hourlySalary, double monthlySalary, int hours){
  10.         this.names = name;
  11.         this.hourlySalary = hourlySalary;
  12.         this.monthlySalary = monthlySalary;
  13.         this.hours = hours;
  14.     }
  15.    
  16.     public double gethourlySalary(int hours){
  17.        
  18.         if(hours > 8)
  19.              hourlySalary = 8 * hourlySalary + (hours-8) * 1.5;
  20.         return hourlySalary;
  21.     }
  22.    
  23.     public double getmonthlySalary(){
  24.         return monthlySalary;
  25.     }
  26. }
  27.  
  28.  
  29.  
  30.  
  31.  
  32. import java.util.ArrayList;
  33.  
  34.  
  35. public class Company {
  36.    
  37.     private ArrayList <Employee> employeeList = new ArrayList();
  38.    
  39.     public Company(Employee...e){
  40.         for(int i=0; i<e.length; i++)
  41.             employeeList.add(e[i]);
  42.     }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement