Cashback Offer (20th - 30th September 2020). Get Flat 10% Cashback credited in your account on a minimum transaction of $80. Post Your Question

Question DetailsNormal
$ 20.00

CIS520 Week 3 Assignment Part 2 Lab 3

Question posted by
Online Tutor Profile
request

Create a new Java Project in Eclipse named HW3 and complete the following two parts.

Part 2 – Inheritance

Create a package named hw3.part2. Using this package create the following classes and implement the specified functionality.

Create a class named Employee as follows.
The instance (or member) private variables – name (String) and wageRate (integer). The wageRate denotes the weekly wages (@40 hours/week) for this employee.
A single constructor with two arguments the name and the wage rate. Set the instance variables with the specified argument values.
The public set and get methods for the two instance variables.
A public computePayStub method which takes a double argument named hours and returns a double showing the weekly wages for this employee. The employee is only paid for a maximum of 40 hours for the week based on the weekly wageRate. If this employee worked less than 40 hours the wages are prorated accordingly.
Override the toString method to return the string representation of this object in the format “Employee:<name of this employee>@$<wageRate>/week”.
No instance variables are allowed in the Consultant class.
A single constructor with two arguments the name and the wage rate. The wage rate represents the hourly rate of this consultant.
Override the computePayStub method which takes a double argument named hours and returns a double showing the weekly wages for this consultant. The consultant is paid for the week based on the hourly wageRate for the first 40 hours. If this consultant worked more than 40 hours the excess hours are paid at 1.5 times the hourly rate. However a maximum of 10 overtime hours is allowed for the pay period.
Override the toString method to return the string representation of this object in the format “Consultant:<name of this consultant>@$<wageRate>/hour”.
Create a derived class from the Employee class named Consultant.
Create a Test class to test the following functionality in its main method.
Declare a variable named currentEmployee of type Employee.
Create an Employee object with name Alice and the weekly wage rate 1000 and assign it to the above variable.
Print to the console the string representation of this object.
Using any of the loop constructs iterate over the computePayStub of this object with the hours 10 20 30 40 50 and 60. Display the wages as shown in the sample below.
Create a Consultant object with name Bob and the hourly wage rate 100. Reassign the currentEmployee to this object.
Repeat the steps shown in c) and d) for this object.
The sample output is shown below.

Available Answer
$ 20.00

[Solved] CIS520 Week 3 Assignment Part 2 Lab 3

  • This solution is not purchased yet.
  • Submitted On 09 May, 2017 10:27:24
Answer posted by
Online Tutor Profile
solution
Solution of the above question...
Buy now to view the complete solution
Other Similar Questions
User Profile
Acade...

CIS520 Week 3 Assignment Part 2 Lab 3

Solution of the above question coming soon, kindly message me if you need solution as soon as possible. Am working on it...
User Profile
Acade...

CIS520 Week 4 Assignment Part 1 And Part 2 Lab 4 Java Programming

Solution of the above question coming soon, kindly message me if you need solution as soon as possible. Am working on it...
User Profile
Acade...

CIS520 Week 5 Assignment Lab 5

Solution of the above question coming soon, kindly message me if you need solution as soon as possible. Am working on it...
User Profile
Acade...

CIS520 Week 6 Assignment Lab 6

Solution of the above question coming soon, kindly message me if you need solution as soon as possible. Am working on it...

The benefits of buying study notes from CourseMerit

homeworkhelptime
Assurance Of Timely Delivery
We value your patience, and to ensure you always receive your homework help within the promised time, our dedicated team of tutors begins their work as soon as the request arrives.
tutoring
Best Price In The Market
All the services that are available on our page cost only a nominal amount of money. In fact, the prices are lower than the industry standards. You can always expect value for money from us.
tutorsupport
Uninterrupted 24/7 Support
Our customer support wing remains online 24x7 to provide you seamless assistance. Also, when you post a query or a request here, you can expect an immediate response from our side.
closebutton

$ 629.35