Lab 5: Inheritance

Due Date 11/23/25 11:59 PM

Objective:

  • Ensure your program compiles successfully.
  • Create an Employee class with two properties: bonus and salary.
  • Define a constructor that accepts two arguments: salary and bonus.
  • Create a void method employeeSkill() that prints "Employee skill method from Employee class".
  • Override the toString() method to display salary and bonus.

Next, create a Programmer class:

  • Add two properties: bonus and salary.
  • Define a constructor that takes salary and bonus, and call the Employee constructor using super.
  • Call the employeeSkill method from Employee using super.employeeSkill().
  • Override the employeeSkill method to print "EmploySkill overriding from Programmer class".

In the Main file:

  • Create a Programmer object.
  • Invoke the toString() method.
  • Call the employeeSkill() method.
Submission Instructions:
  1. Include your full name and email at the top of your file using comment tags.
  2. Compile and run the program. Enter all required inputs.
  3. Take a screenshot of the result/output.
  4. Zip the project folder containing:
    • Expected output
    • Employee skill method from Employee class
      Salary: 80000.0, Bonus: 5000.0
      EmployeeSkill overriding from Programmer class
  5. Upload the zipped file to Blackboard.