-
-
Save mamiwinsfall93/73b4a00bdf58be9af1544fa446ecd5e8 to your computer and use it in GitHub Desktop.
Revisions
-
mamiwinsfall93 created this gist
Jan 18, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,57 @@ /** Filename: Employee.java * Author: Ndatta Fall * Purpose: Executive employee classes with salary information * */ public class Executive extends Employee{ private int stockPrice; public Executive(String name, int monthlySalary, int stockPrice) { super(name, monthlySalary); this.stockPrice = stockPrice; } public int AnnualSalary() { int bonus = 0; if(stockPrice > 50) bonus = 30000; int totalPay = (getMonthlySalary() * 12) + bonus; return totalPay; } public String toString() {// returns employee's information String employeeInfo = "employee's name: " + getName() + "\n" + "Monthly salary : " + getMonthlySalary() + "\n" + "Annual salary : " + AnnualSalary(); return employeeInfo; } public int getStockPrice() { return stockPrice; } public void setStockPrice(int stockPrice) { this.stockPrice = stockPrice; } }