Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in java Object Oriented Programming Lab 4 Objectives: In this lab we are going to practice how to work with abstract class, abstract methods, inheritance,

in java
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Object Oriented Programming Lab 4 Objectives: In this lab we are going to practice how to work with abstract class, abstract methods, inheritance, polymorphism and object composition concepts Employer SalariedEmployee Commision Employee Haunty Employee Employee Salaried Employee BasePlusCommissionEmployee carnings toString fram abstract social security number: salaried employees from social security number: 1 weekly salary: ry if Chours 40) wage hours hourly employees om else if thours 40) social security number: SSN 40 we hourly wage hours worked: Chours - 40 ) wage 15 Hourly Employee Comission Commissionate Employee gross Sales Commission loyee flomme social security numbers gress sales: poes: commission rate: con base salaried comission loyee: Jestemme social security ruber: SSN gross sales po Commission rate com base salary: biay BasePlus commissionate Commission grossSales). Employee basasalary Object Oriented Programming 1- Define abstract class Employee to represent the general concept of an employee a. Define earning method as an abstract method. public abstract double earning 0); Employee String FirstName, String LastName Int socialSecurity Number 2 constructors 3 Setters 3 Getters lloverride methods 1 toString Abstract method earning () Why we decide to declare earning method as abstract method? 2- Define concrete class SalariedEmployee that extends Employee class and override toString and earning methods. a. You can use Super in the constructors and toString method b. earning method return the WeeklySalary value (use get method). SalariedEmployee double weeklySalary 2 constructors (use Super) 1 Setter 1 Getter lloverride methods toString earning 0 3. Define concrete class HourlyEmployee that extends Employeeclass and override to String and eaming methods. a. You can use Super in the constructors and toString method b. earning method return ( wage hours if the hours

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Instant Reference

Authors: Gruber, Martin Gruber

2nd Edition

0782125395, 9780782125399

More Books

Students also viewed these Databases questions