For this lab you will make some changes to your Piecework class from Lab 2A and also create a new derived class based on your Piecework class to allow for calculations of pay for senior workers implementing a different pay procedure and scale.
Senior Piecework workers, like regular Piecework workers, are paid by the piece with workers who produce a greater number of pieces receiving more pay based on production and incrementally higher rates based on that production. The major difference, beyond a different pay scale, is that Senior Piecework workers are paid a base pay of $300 plus the per-piece rate as they are more dependably productive workers.
Create a new class file for this derived class called “SeniorWorkers”. It is strongly suggested that you take a critical look at your Lab 2A and 2B results to ensure you are creating, and naming, the required elements of this class appropriately.
Business Tier – Piecework Class Changes:
Make the necessary changes to allow access to necessary properties and/or methods by a derived class. The derived class requires access to the properties and procedures for worker name, number of pieces and pay as well as all shared summary properties and procedures.
Make the required change to the access specifier for your pay calculation method to allow access by the presentation tier. Additionally, the derived class will have its own method for calculating pay that will override the method of the same name in the base class.
Remove the call to your pay calculation method from the parameterized constructor as now that method will now be called separately after object instantiation from the presentation tier.
Business Tier – Senior Piecework Class:
Create a new derived class, (a new .vb class file, not in the same file) that inherits from Piecework and include a default constructor.
This class should also have a parameterized constructor that calls the base class’ default constructor and then sets the worker name and number of pieces using the matching base class property procedures.
The “findPay” method for this class utilizes the pay rates listed below and also includes a base pay for each Senior Worker of $300.00, regardless of their production. This method must be accessible by any class outside of this class (but not the world).
Senior Pay Rates:
Pieces Completed Price Paid Per Piece for all Pieces 1 – 199 .20 200 – 399 .25 400 – 599 .30 600 - 799 .35 800 or more .40
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference
and should not be submitted as is. We are not held liable for any misuse of the solutions.
Please see the frequently asked questions page
for further questions and inquiries.
Kindly complete the form.
Please provide a valid email address and we will get back to you within 24 hours.
Payment is through PayPal, Buy me a Coffee
or Cryptocurrency.
We are a nonprofit organization however we need funds to keep this organization operating
and to be able to complete our research and development projects.