0% found this document useful (0 votes)
244 views2 pages

Create A Class Payslip With Below Methods.: Double

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 2

Create a class PaySlip with below methods.

calculateBasicSal(double grossSal) :- This method returns basic salry based on


given gross salary

calculatePF(double basicSal):- This method returns pf based on given basic


salary

calculateHRA(double basicSal):-This method returns hra based on given basic


salary

calculateTotalSal(double basicSal, double hra,double cityallowance,


double sundry, double lta,double performencePay):- This
method returns totalsal based on given added componets specified in below.

calculateTotalDeductions(double totalSal, double pf,double profTax,


double incomTax):-This method returns totaldeductions
based on given deducted componets specified in below.

calculateAnualSal(double totalSal):-This method returns anualsal based on given


totalsal.

calculateAualRevisedSal(double anualSal,double percentageHike):-This method


returns revisedSal based on given anualSal and percentageHike.
Take GrossSalary as 60000 rupees.

To Calculate Baisc Salary,PF,HRA use below information

Basic 40% of gross salary


PF 12% on Basic
HRA 50% on Basic

To claculate TotalSal and Deductions use below Information

Deducted components to the Total Salary are pf, profTax,incomTax

Added components to the Total Salary are basicSal, hra, cityallowance, sundry,
lta, performencePay

create main method in PaySlipDemo class and create PaySlip object and invoke all
the methods defined in PaySlip class.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy