Person and Employee class are already in this activity. No need to add those classes to your code. For example: Test Result CommissionEmployee c = new

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Make Java Abstract CommissionEmployee class

  1. provide the setters and getters of your data members
  2. implement abstract method
  3. Override the toString and equals of Employee


Note:
Person and Employee class are already in this activity. No need to add those classes to your code.

For example:

Test Result

CommissionEmployee c = new CommissionEmployee ("Yule Josef Ato","Cebu City",23,"Accenture",40000.0f, 550, 0.10f);

System.out.println(c);

System.out.println("\nEarnings: "+c.earnings());

Name: Yule Josef Ato

Address: Cebu City Age: 23

Company name: Accenture

Regular salary: 40000.0

Item sold: 550

Commission rate: 0.1

Earnings: 40055.0

CommissionEmployee c = new CommissionEmployee ("Yule Josef Ato","Cebu City",23,"Accenture",40000.0f, 550, 0.10f);

CommissionEmployee c2 = new CommissionEmployee ("Yule Josef Ato","Cebu City",23,"Accenture",40000.0f, 550, 0.10f); c.display();

System.out.println(c.equals(c2));

Name : Yule Josef Ato Address : Cebu City Age : 23 Company Name: Accenture

true

Complete the code:

class CommissionEmployee extends Employee {

    private float regularSalary;  //fixed monthly salary
    private int itemSold;          //total number of items sold
    private float commissionRate;    //rate per item (in decimal form)

    public CommissionEmployee(String name,String address,
            int age,String cName, float regSal, int nItems,
            float commission) {
        regularSalary = regSal;
        itemSold = nItems;
        commissionRate = commission;
    }

    public CommissionEmployee() {

    }

    // provide the setters and getters of your data members


    
        //the total earnings of a commission employee is the sum of
        //the monthly salary plus the commission.
        //commission will be based on the total number of items sold
        //times the commission rate per item.


    // override the toString() and equals() methods

}

 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Knowledge Booster
Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education