reate an interface Employee which has the attribute: rate, and the method getSalary(). 2. Implement the Employee interface with two classes: Hourly and Commissioned. 3. Hourly employee has the following additional attribute: hoursWorked. Hourly wage is 300 money. 4. Commissioned employee has the following additional attribute: itemSold. Commissioned employees get 200 money per item sold. If item sold is greater than 100, any items sold after 100 has +10 money bonus. Inputs 1. First line contains the type of Employee (H or C) 2. Second line is for the hours worked or the items sold depending on the type of employee Sample Output Enter type of e

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter6: Arrays
Section: Chapter Questions
Problem 5PE
icon
Related questions
Question

Java - Interface

1. Create an interface Employee which has the attribute: rate, and the method getSalary().

2. Implement the Employee interface with two classes: Hourly and Commissioned.

3. Hourly employee has the following additional attribute: hoursWorked. Hourly wage is 300 money.

4. Commissioned employee has the following additional attribute: itemSold.

Commissioned employees get 200 money per item sold. If item sold is greater than 100, any items sold after 100 has +10 money bonus.

Inputs

1. First line contains the type of Employee (H or C)

2. Second line is for the hours worked or the items sold depending on the type of employee

Sample Output

Enter type of employee: H

Enter hours worked: 10

Salary: 3000

Test Cases
O Constraint 1
The code must contain an interface Employee.
Test Cases
Executions
O Test Case 1
Expected Output
Enter type of employee: H
Enter hours worked: 10
Salary: 3000
1
Transcribed Image Text:Test Cases O Constraint 1 The code must contain an interface Employee. Test Cases Executions O Test Case 1 Expected Output Enter type of employee: H Enter hours worked: 10 Salary: 3000 1
Expert Solution
steps

Step by step

Solved in 5 steps with 2 images

Blurred answer
Knowledge Booster
Developing computer interface
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
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT