C++ Program for Calculating Net Pay with Income Tax and Pension Deductions, Assignments of Programming Languages

This C++ program calculates the net pay of an employee based on their basic salary, allowance, pension, income tax, and credit association deductions. The user inputs the basic salary, allowance, and credit association, and the program calculates the pension, income tax, total deduction, and net pay using a series of functions. The program also displays the gross salary, income tax, pension, total deduction, and net pay.

Typology: Assignments

2020/2021

Uploaded on 04/15/2021

mintesinot-samuel
mintesinot-samuel 🇪🇷

1 document

1 / 6

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
UNIT UNIVERSITY
Programming Assignment
Dept Co.Sc
Name Mintesinot Samuel
Id no 02691/12
pf3
pf4
pf5

Partial preview of the text

Download C++ Program for Calculating Net Pay with Income Tax and Pension Deductions and more Assignments Programming Languages in PDF only on Docsity!

UNIT UNIVERSITY

Programming Assignment

Dept Co.Sc

Name Mintesinot Samuel

Id no 02691/

#include using namespace std; int main() { float BasicSalary,Allowance,GrowthSalary; float Pension,CreditAssosiation; float TotalDeduction,IncomeTax,NetPay; cout<<"Insert Basic Salary:"; cin>>BasicSalary; cout<<"Insert Allowance:"; cin>>Allowance; cout<<"Insert Creadit Assosiation:"; cin>>CreditAssosiation; cout<<"Basic Salary="<<BasicSalary<<endl; cout<<"Allowance="<<Allowance<<endl; cout<<"Creadit Assosiation="<<CreditAssosiation<<endl; Pension=0.07BasicSalary; cout<<"Pension="<<Pension<<endl; GrowthSalary=(BasicSalary+Allowance); cout<<"Growth Salary="<<GrowthSalary<<endl; if((BasicSalary>=0)&&(BasicSalary<=600)) { IncomeTax=0BasicSalary; cout<<"Income Tax="<<IncomeTax<<endl; } else if((BasicSalary>=601)&&(BasicSalary<=1650)) { IncomeTax=0.1*BasicSalary; cout<<"Income Tax="<<IncomeTax<<endl; } else if((BasicSalary>=1651)&&(BasicSalary<=3200)) {

#include using namespace std; //declare function int GrowthSalary(float Salary, float Allow); int IncomeTax(float Salary); int TotalDeduction(float Pen, float Incometax, float CredAss); int NetPay(float gSalary, int totDeduct); int Pension(float Salary); int main() { float Salary, totDeduction, Netpay, Incometax,Pen, CredAss, gSalary, Allow; //input output cout<<"Insert Basic Salary:"; cin>>Salary; cout<<"Insert Allowance:"; cin>>Allow; cout<<"Insert Creadit Assosiation:"; cin>>CredAss; //function call gSalary=GrowthSalary(Salary, Allow); Incometax=IncomeTax(Salary); Pen=Pension(Salary); totDeduction=TotalDeduction(Pen, Incometax, CredAss); Netpay=NetPay(gSalary, totDeduction); //display cout<<"==================================================="<<endl; cout<<" Gross Salary:"<<" "<<gSalary<<endl; cout<<" Income Tax:"<<" "<<Incometax<<endl; cout<<" Penssion:"<<" "<<Pen<<endl;

cout<<" Total Deduction:"<<" "<<totDeduction<<endl; cout<<" Net Pay:"<<" "<<Netpay<<endl; cout<<"==================================================="<<endl; return 0; } //******Calculate Gross Salary********* int GrowthSalary(float Salary, float Allow){ float grSal=(Salary + Allow); return grSal; } //******Calculate Income Tax********* int IncomeTax(float Salary){ int Tax; if((Salary>=0)&&(Salary<=600)) { Tax=0Salary; } else if((Salary>=601)&&(Salary<=1650)) { Tax=0.1Salary; } else if((Salary>=1651)&&(Salary<=3200)) { Tax=0.15Salary; } else if((Salary>=3201)&&(Salary<=5250)) { Tax=0.2Salary; } else if((Salary>=5251)&&(Salary<=7800)) { Tax=0.25*Salary; } else if((Salary>=7801)&&(Salary<=10900)) {