In the lab, you have to design four classes: 1 base class, 2 sub-classes, and 1 driver test class.
In the lab, you have to design four classes: 1 base class, 2 sub-classes, and 1 driver test class.
/>
Let’s see if we can build up the *pseudocode* for these classes together to some extent. We’ll start off with the following stubs (outlines) of the four classes. Can we extend them to include some of the required elements from the problem specification?
Please note: pseudocode, and the outline stub below, are just tools to help make development of the solution easier. Most people find these tools helpful but, if they don’t seem helpful for you right now, it’s perfectly okay to not utilize them. As the programs you develop become more complex, though, you’ll probably need intermediate steps or approaches to make getting a handle on the solution more tractable.
Please remember: *what’s below is a stub, not pseudocode*; this stub is an outline of what your program will look like, not details of the instructions, which is what the pseudocode will provide.
Please note: in the following discussion, //please do *NOT* post any actual Java code// and __only add *pseudocode*__!
// Base Class Declaration
public class Employee {
// Declare the three fields
// Declare the constructor
// Declare your accessors and mutators
// Declare your getWeeklyPay() method: Standard pay = hours worked * rate for up to 40 hours – no overtime
}
// Declare first sub-class called UnionEmployee
public class … {
// Declare the field
// Declare the explicit-value constructor
// Declare the mutator
// Overload the base class’ getWeeklyPay() method
}
// Declare second sub-class called CommissionEmployee
public class … {
// Declare the two fields
// Declare the explicit-value constructor
// Declare the mutators
// Overload the base class’ getWeeklyPay() method
}
// Declare the test driver class:
public class TestDriverClass {
// Declare the helper display() method which accepts an Employee object reference and int hours
// Declare the main() method:
public static void main(String args[]) {
// Declare a UnionEmployee object
// Declare a CommissionEmployee object
// Display their calculations for various cases
}
}
Looking for a Similar Assignment? Order now and Get 10% Discount! Use Coupon Code "Newclient"
![](https://sp-ao.shortpixel.ai/client/to_webp,q_glossy,ret_img,w_320,h_80/http://academicheroes.com/wp-content/uploads/2018/09/order_now.png)