Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class FirmStaff{
- Volunteer[] staffList= new Volunteer[3];
- Payable[] sList= new Payable[2];
- double payReturn;
- double payAmount=0;
- public FirmStaff(){
- staffList[0]= new Volunteer("Curley Howard", "222 Stooge Street", "8675309", "183457612", 8.75);
- staffList[1]= new Volunteer("Moe Howard", "222 Stooge Street", "8675309", "177645555", 7.50);
- staffList[2]= new Volunteer("Larry Fine", "123 Fine Street", "2435555", "155649889", 25.00);
- sList[0]= new Hourly("Dan Marino", "1972 Dolphin Street", "9991972", "15843928", 7.50, 15.50);
- sList[1]= new Admin("Don Shula", "1974 Dolphin Street", "9891973", "198583834", 27.50, 29.5, 1875.75);
- }
- public String toString(){
- String result= "";
- for(Payable n: sList){
- result += n.toString();
- }
- return result;
- }
- public double Pay(){
- double payAmount=0;
- for (int count=0; count < sList.length; count++)
- {
- System.out.println (sList[count]);
- payAmount = sList[count].Pay();
- if (payAmount == 0.0)
- System.out.println("Thanks!");
- else
- System.out.println ("Paid: " + payAmount);
- System.out.println ("-----------------------------------");
- }
- return payAmount;
- }
- }
- public class Employee extends FirmStaff implements Payable{
- double payRate;
- String name;
- String address;
- String phoneNum;
- String socsecNum;
- String ssNum;
- double payrate;
- public Employee(String name, String address, String phoneNum, String socsecNum, double hours){
- super( name, address, phoneNum);
- this.socsecNum= ssNum;
- }
- public double Pay(){
- return(getPayRate());
- }
- public double getPayRate(){
- return payRate;
- }
- public String toString(){
- return name+" is paid at a rate of "+ getPayRate();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement