Csis 312 week 3 assignment. Quality work eith no plagiarism

find the attachments . 2018 pauci- skills for the programming. I do not want work gotten from the net because I will know. See the attachments for instructions and grading rubric
assignment_3_instructions.docx

homework_assignment_3.docx

Don't use plagiarized sources. Get Your Custom Essay on
Csis 312 week 3 assignment. Quality work eith no plagiarism
Just from $13/Page
Order Essay

Unformatted Attachment Preview

CSIS 312
ASSIGNMENT 3 INSTRUCTIONS
Assignment 3
Modify the payroll system of Figs. 10.4–10.9 to include an additional Employee subclass
PieceWorker that represents an employee whose pay is based on the number of pieces of
merchandise produced.
Class PieceWorker should contain private instance variables wage (to store the employee’s wage
per piece) and pieces (to store the number of pieces produced).
Provide a concrete implementation of method earnings in class PieceWorker that calculates the
employee’s earnings by multiplying the number of pieces produced by the wage per piece.
Create an array of Employee variables to store references to objects of each concrete class in the
new Employee hierarchy (SalariedEmployee, CommissionEmployee, HourlyEmployee,
BasePlusCommissionEmployee, and now PieceWorker).
For each Employee, display its String representation and earnings.
PieceWorker
Submit this assignment by 11:59 p.m. (ET) on Monday of Module/Week 3.
// Fig. 10.7: CommissionEmployee.java
// CommissionEmployee class extends Employee.
public class CommissionEmployee extends Employee
{
private double grossSales; // gross weekly sales
private double commissionRate; // commission percentage
// constructor
public CommissionEmployee(String firstName, String lastName,
String socialSecurityNumber, double grossSales,
double commissionRate)
{
super(firstName, lastName, socialSecurityNumber);
if (commissionRate <= 0.0 || commissionRate >= 1.0) // validate
throw new IllegalArgumentException(
“Commission rate must be > 0.0 and < 1.0"); if (grossSales < 0.0) // validate throw new IllegalArgumentException("Gross sales must be >= 0.0″);
this.grossSales = grossSales;
this.commissionRate = commissionRate;
}
// set gross sales amount
public void setGrossSales(double grossSales)
{
if (grossSales < 0.0) // validate throw new IllegalArgumentException("Gross sales must be >= 0.0″);
this.grossSales = grossSales;
}
// return gross sales amount
public double getGrossSales()
{
return grossSales;
}
// set commission rate
public void setCommissionRate(double commissionRate)
{
if (commissionRate <= 0.0 || commissionRate >= 1.0) // validate
throw new IllegalArgumentException(
“Commission rate must be > 0.0 and < 1.0"); this.commissionRate = commissionRate; } // return commission rate public double getCommissionRate() { return commissionRate; } // calculate earnings; override abstract method earnings in Employee @Override public double earnings() { return getCommissionRate() * getGrossSales(); } // return String representation of CommissionEmployee object @Override public String toString() { return String.format("%s: %s%n%s: $%,.2f; %s: %.2f", "commission employee", super.toString(), "gross sales", getGrossSales(), "commission rate", getCommissionRate()); } } // end class CommissionEmployee // Fig. 10.8: BasePlusCommissionEmployee.java // BasePlusCommissionEmployee class extends CommissionEmployee. public class BasePlusCommissionEmployee extends CommissionEmployee { private double baseSalary; // base salary per week // constructor public BasePlusCommissionEmployee(String firstName, String lastName, String socialSecurityNumber, double grossSales, double commissionRate, double baseSalary) { super(firstName, lastName, socialSecurityNumber, grossSales, commissionRate); if (baseSalary < 0.0) // validate baseSalary throw new IllegalArgumentException("Base salary must be >= 0.0″);
this.baseSalary = baseSalary;
}
// set base salary
public void setBaseSalary(double baseSalary)
{
if (baseSalary < 0.0) // validate baseSalary throw new IllegalArgumentException("Base salary must be >= 0.0″);
this.baseSalary = baseSalary;
}
// return base salary
public double getBaseSalary()
{
return baseSalary;
}
// calculate earnings; override method earnings in CommissionEmployee
@Override
public double earnings()
{
return getBaseSalary() + super.earnings();
}
// return String representation of BasePlusCommissionEmployee object
@Override
public String toString()
{
return String.format(“%s %s; %s: $%,.2f”,
“base-salaried”, super.toString(),
“base salary”, getBaseSalary());
}
} // end class BasePlusCommissionEmployee
// Fig. 10.4: Employee.java
// Employee abstract superclass.
public abstract class Employee
{
private final String firstName;
private final String lastName;
private final String socialSecurityNumber;
// constructor
public Employee(String firstName, String lastName,
String socialSecurityNumber)
{
this.firstName = firstName;
this.lastName = lastName;
this.socialSecurityNumber = socialSecurityNumber;
}
// return first name
public String getFirstName()
{
return firstName;
}
// return last name
public String getLastName()
{
return lastName;
}
// return social security number
public String getSocialSecurityNumber()
{
return socialSecurityNumber;
}
// return String representation of Employee object
@Override
public String toString()
{
return String.format(“%s %s%nsocial security number: %s”,
getFirstName(), getLastName(), getSocialSecurityNumber());
}
// abstract method must be overridden by concrete subclasses
public abstract double earnings(); // no implementation here
} // end abstract class Employee
// Fig. 10.6: HourlyEmployee.java
// HourlyEmployee class extends Employee.
public class HourlyEmployee extends Employee
{
private double wage; // wage per hour
private double hours; // hours worked for week
// constructor
public HourlyEmployee(String firstName, String lastName,
String socialSecurityNumber, double wage, double hours)
{
super(firstName, lastName, socialSecurityNumber);
if (wage < 0.0) // validate wage throw new IllegalArgumentException( "Hourly wage must be >= 0.0″);
if ((hours < 0.0) || (hours > 168.0)) // validate hours
throw new IllegalArgumentException(
“Hours worked must be >= 0.0 and <= 168.0"); this.wage = wage; this.hours = hours; } // set wage public void setWage(double wage) { if (wage < 0.0) // validate wage throw new IllegalArgumentException( "Hourly wage must be >= 0.0″);
this.wage = wage;
}
// return wage
public double getWage()
{
return wage;
}
// set hours worked
public void setHours(double hours)
{
if ((hours < 0.0) || (hours > 168.0)) // validate hours
throw new IllegalArgumentException(
“Hours worked must be >= 0.0 and <= 168.0"); this.hours = hours; } // return hours worked public double getHours() { return hours; } // calculate earnings; override abstract method earnings in Employee @Override public double earnings() { if (getHours() <= 40) // no overtime return getWage() * getHours(); else return 40 * getWage() + (getHours() - 40) * getWage() * 1.5; } // return String representation of HourlyEmployee object @Override public String toString() { return String.format("hourly employee: %s%n%s: $%,.2f; %s: %,.2f", super.toString(), "hourly wage", getWage(), "hours worked", getHours()); } } // end class HourlyEmployee // Fig. 10.9: PayrollSystemTest.java // Employee hierarchy test program. public class PayrollSystemTest { public static void main(String[] args) { // create subclass objects SalariedEmployee salariedEmployee = new SalariedEmployee("John", "Smith", "111-11-1111", 800.00); HourlyEmployee hourlyEmployee = new HourlyEmployee("Karen", "Price", "222-22-2222", 16.75, 40); CommissionEmployee commissionEmployee = new CommissionEmployee( "Sue", "Jones", "333-33-3333", 10000, .06); BasePlusCommissionEmployee basePlusCommissionEmployee = new BasePlusCommissionEmployee( "Bob", "Lewis", "444-44-4444", 5000, .04, 300); System.out.println("Employees processed individually:"); System.out.printf("%n%s%n%s: $%,.2f%n%n", salariedEmployee, "earned", salariedEmployee.earnings()); System.out.printf("%s%n%s: $%,.2f%n%n", hourlyEmployee, "earned", hourlyEmployee.earnings()); System.out.printf("%s%n%s: $%,.2f%n%n", commissionEmployee, "earned", commissionEmployee.earnings()); System.out.printf("%s%n%s: $%,.2f%n%n", basePlusCommissionEmployee, "earned", basePlusCommissionEmployee.earnings()); // create four-element Employee array Employee[] employees = new Employee[4]; // initialize array with Employees employees[0] = salariedEmployee; employees[1] = hourlyEmployee; employees[2] = commissionEmployee; employees[3] = basePlusCommissionEmployee; System.out.printf("Employees processed polymorphically:%n%n"); // generically process each element in array employees for (Employee currentEmployee : employees) { System.out.println(currentEmployee); // invokes toString // determine whether element is a BasePlusCommissionEmployee if (currentEmployee instanceof BasePlusCommissionEmployee) { // downcast Employee reference to // BasePlusCommissionEmployee reference BasePlusCommissionEmployee employee = (BasePlusCommissionEmployee) currentEmployee; employee.setBaseSalary(1.10 * employee.getBaseSalary()); System.out.printf( "new base salary with 10%% increase is: $%,.2f%n", employee.getBaseSalary()); } System.out.printf( "earned $%,.2f%n%n", currentEmployee.earnings()); } // get type name of each object in employees array for (int j = 0; j < employees.length; j++) System.out.printf("Employee %d is a %s%n", j, employees[j].getClass().getName()); } // end main } // end class PayrollSystemTest // Fig. 10.5: SalariedEmployee.java // SalariedEmployee concrete class extends abstract class Employee. public class SalariedEmployee extends Employee { private double weeklySalary; // constructor public SalariedEmployee(String firstName, String lastName, String socialSecurityNumber, double weeklySalary) { super(firstName, lastName, socialSecurityNumber); if (weeklySalary < 0.0) throw new IllegalArgumentException( "Weekly salary must be >= 0.0″);
this.weeklySalary = weeklySalary;
}
// set salary
public void setWeeklySalary(double weeklySalary)
{
if (weeklySalary < 0.0) throw new IllegalArgumentException( "Weekly salary must be >= 0.0″);
this.weeklySalary = weeklySalary;
}
// return salary
public double getWeeklySalary()
{
return weeklySalary;
}
// calculate earnings; override abstract method earnings in Employee
@Override
public double earnings()
{
return getWeeklySalary();
}
// return String representation of SalariedEmployee object
@Override
public String toString()
{
return String.format(“salaried employee: %s%n%s: $%,.2f”,
super.toString(), “weekly salary”, getWeeklySalary());
}
} // end class SalariedEmployee

Purchase answer to see full
attachment

GradeAcers
Calculate your paper price
Pages (550 words)
Approximate price: -

Why Work with Us

Top Quality and Well-Researched Papers

We always make sure that writers follow all your instructions precisely. You can choose your academic level: high school, college/university or professional, and we will assign a writer who has a respective degree.

Professional and Experienced Academic Writers

We have a team of professional writers with experience in academic and business writing. Many are native speakers and able to perform any task for which you need help.

Free Unlimited Revisions

If you think we missed something, send your order for a free revision. You have 10 days to submit the order for review after you have received the final document. You can do this yourself after logging into your personal account or by contacting our support.

Prompt Delivery and 100% Money-Back-Guarantee

All papers are always delivered on time. In case we need more time to master your paper, we may contact you regarding the deadline extension. In case you cannot provide us with more time, a 100% refund is guaranteed.

Original & Confidential

We use several writing tools checks to ensure that all documents you receive are free from plagiarism. Our editors carefully review all quotations in the text. We also promise maximum confidentiality in all of our services.

24/7 Customer Support

Our support agents are available 24 hours a day 7 days a week and committed to providing you with the best customer experience. Get in touch whenever you need any assistance.

Try it now!

Calculate the price of your order

Total price:
$0.00

How it works?

Follow these simple steps to get your paper done

Place your order

Fill in the order form and provide all details of your assignment.

Proceed with the payment

Choose the payment system that suits you most.

Receive the final file

Once your paper is ready, we will email it to you.

Our Services

No need to work on your paper at night. Sleep tight, we will cover your back. We offer all kinds of writing services.

Essays

Essay Writing Service

No matter what kind of academic paper you need and how urgent you need it, you are welcome to choose your academic level and the type of your paper at an affordable price. We take care of all your paper needs and give a 24/7 customer care support system.

Admissions

Admission Essays & Business Writing Help

An admission essay is an essay or other written statement by a candidate, often a potential student enrolling in a college, university, or graduate school. You can be rest assurred that through our service we will write the best admission essay for you.

Reviews

Editing Support

Our academic writers and editors make the necessary changes to your paper so that it is polished. We also format your document by correctly quoting the sources and creating reference lists in the formats APA, Harvard, MLA, Chicago / Turabian.

Reviews

Revision Support

If you think your paper could be improved, you can request a review. In this case, your paper will be checked by the writer or assigned to an editor. You can use this option as many times as you see fit. This is free because we want you to be completely satisfied with the service offered.

Order your essay today and save 15% with the discount code DISCOUNT15