Posts

Showing posts with the label Salary

In C Program, Compute Hike In Salary For N Employees

Image
Download

In JavaScript, Compute Gross Salary Of Salesperson Based On Weekly Sales

Image
<!DOCTYPE html> <html lang="en-US"> <head> <title>Weekly Salary</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"/> </head> <body onload="showSalaries();"> <h1>Weekly Salary</h1> <form onsubmit="newSale(this);return false;" autocomplete="off"> <label>Gross Weekly Sales<label> <input name="sales" required="" pattern="^\d*$" title="Positive numbers only!" autofocus=""/> <button>Submit</button> </form> <table border="1" cellspacing="0" cellpadding="5" style="margin-top:10px;"> <thead> <tr> <th>Salaries</th> <th>No# of Salesperson</th> </tr> </thead> <tbody id="out"/> </table> <scr...

In C++, Compute Salary Of Full time Employee & Manager

Image
#include<iostream> using namespace std; class Employee{ protected: double baseSalary; int yearsOfService; public: Employee(double base, int years){ baseSalary = base; yearsOfService = years; } virtual double salary() = 0; }; class FulltimeEmployee : public Employee{ public: FulltimeEmployee(double base, int years): Employee(base, years){} double salary(){ double result = baseSalary; for(int year = 1; yearsOfService >= year; year++){ result += (result * 0.05); } return result; } }; class Manager: public FulltimeEmployee{ protected: int nosDirectReports; public: Manager(double base, int years, int reports): FulltimeEmployee(base, years){ nosDirectReports = reports; } double salary(){ double result = FulltimeEmployee::salary(); result += nosDirectReports * 0.1; return result; } }; int main(){ Employee *emp; emp = new FulltimeEmployee(300.0, 5); cout << "Fulltime Employee's salary: $...

Compute employee's salary hike and deductions with Java

Image
public class Details{ private String empId; private String fName; private String lName; private double salary; public double getUpdatedSalary(){ salary += (salary*0.1); return salary; } public String getEmpId(){ return empId; } public String getFName(){ return fName; } public String getLName(){ return lName; } public void setEmpId(String empId){ this.empId = empId; } public void setFName(String fName){ this.fName = fName; } public void setLName(String lName){ this.lName = lName; } public void setSalary(double salary){ this.salary = salary; } public double getSalary(){ return salary; } } public class Test{ public static void main(String[]args){ Details d = new Details(); d.setFName("Will"); d.setLName("Smith"); d.setEmpId("E001"); d.setSalary(11000); printDetails(d); d.getUpdatedSalary(); printDetails(d); salaryDeductions(d); } private static void printDetails(Details d){ Sys...