Discount Get CS 520 ALL WEEKS Solution ONLY $154.91
CS520, CIS 520, CIS 520 Week 1 assignment - iLab 1 - Lab 1 - Java... [$8.99]
CS520, CIS 520, CIS 520 Week 2 assignment Part 1 - iLab 2 - Lab 2... [$11.99]
CS520, CIS 520, CIS 520 Week 2 assignment Part 2 - iLab 2 - Lab 2... [$15.99]
CS520, CIS 520, CIS 520 Week 2 assignment Part 3 - iLab 2 - Lab 2... [$19.99]
CS520, CIS 520, CIS 520 Week 3 assignment Part 1 - iLab 3 - Lab 3... [$15.99]
CS520, CIS 520, CIS 520 Week 3 assignment Part 2 - iLab 3 - Lab 3... [$19.99]
CS520, CIS 520, CIS 520 Week 4 assignment Part 1 and Part 2 - iLa... [$21.99]
CS520, CIS 520, CIS 520 Week 5 assignment - iLab 5 - Lab 5 - Java... [$19.99]
CS520, CIS 520, CIS 520 Week 6 assignment - iLab 6 - Lab 6 - Java... [$19.99]
Get Selected Weeks Solution with ONLY NOT Add Selected Tutorials To Cart
CS520, CS 520, CS 520 Week 3 assignment Part 2 - iLab 3 - Lab 3 - Java Programming
    CS520, CS 520, CS 520 Week 3 assignment Part 2 - iLab 3 - Lab 3 - Java Programming

CS520, CS 520, CS 520 Week 3 assignment Part 2 - iLab 3 - Lab 3 - Java Programming

$19.99

Week 3 Assignment
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.

My tutorial contains Java Programs - Eclipse Project and Document.

If you have more questions, please contact me via email support@extutorials.com

I will help you any time

Thank you !

Attached Files

Move over [ preview ] file name to preview content in it!

  • HW3_lastname.zip [9.4KB]
    • .classpath
      • .project
        • .settings
        • bin
        • src
          • hw3
            • part1
              • RedAndBlackSteps.java [1KB] [ preview ]
            • part2
              • Consultant.java [0.5KB] [ preview ]
              • Employee.java [0.6KB] [ preview ]
              • Test.java [0.7KB] [ preview ]

      Write a review

      Your Name:


      Your Review: Note: HTML is not translated!

      Rating: Bad           Good

      Enter the code in the box below:



      Tags: CS520, CS 520
      PURCHASE SAVE
      2 Tutorials 10%
      3 Tutorials 13%
      4 Tutorials 16%
      5 Tutorials 19%
      6 Tutorials 22%
      7 Tutorials 25%
      8 Tutorials 28%
      9 Tutorials 31%
      10 Tutorials 34%
      add url more

      9MZQASHWN73B