QuestionQuestion

Transcribed TextTranscribed Text

Description: Write a complete class AcmeCorporat: ion when run will: a. Create an array of Person in the organization and initialize them to different types of Employee and Volunteer. Person b. Add the class Volunteer, subclass of Person and pay() returns 0. name Sting c. Add the class UnionMember, subclass of Hourly and payO returns 40 hours normal pay as Hourly, over 40 hours, 1.5 pay. atring d. Add some hours to the Hourly employees. e. Generate the weekly payroll report by calling payO for each employee. Employee f. Output the total payout 550 integer g. Output the count of the number of volunteers. Gring h. Implement all the classes in a single Java source file. toString() - Person: returns name, Employee: returns name.[ssul payO returns the pay for the employee Salaried Hourly Salaried: weeklySalary, Hourly: hourlyRate X hoursWorked deuble doubte hoursWerked: Sample weekly payroll report: Acme Corporation Weekly Payroll by F. Last Pay $1200.00 to John Pay $600.00 to Jane [234-56-7890] Pay $3000.00 to Michael [345-67-8901] Pay $750.00 to Cathy [4567-89-0123] UniceMember Pay $0 to Tyler [Volunteer] Total payout = $5550.00 1 volunteers toBtring: atring

Solution PreviewSolution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

public class AcmeCorporation {

// main method for executing test/evaluation code
public static void main(String[] args){
    Person[] personnel = {
      new Salaried("John", 123456789, 1200),
      new Hourly("Jane", 234567890, 15),
      new Salaried("Michael", 345678901, 3000),
      new Hourly("Cathy", 456789012, 25),
      new Volunteer("Tyler")
    };
    ((Hourly) personnel[1]).addHours(40);
    ((Hourly) personnel[3]).addHours(30);
   
    int volunteersCount = 0;
    double payout = 0;
   
    System.out.println("Acme Corporation Weekly Payroll by F. Last");
    System.out.println();
   
    for(Person person: personnel){
      double pay = person.pay();
      String name = person.toString();
      System.out.println("Pay $"+String.format("%.2f",pay)+" to "+name);
      payout += pay;
      if(person instanceof Volunteer){
       volunteersCount++;
      }
    }
   
    System.out.println("Total payout = "+payout);
    System.out.println(volunteersCount+" volunteers");
}
}...

By purchasing this solution you'll be able to access the following files:
Solution.java.

$30.00
for this solution

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Java Programming Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats