Program to calculate gross pay and tax payable, C/C++ Programming

Study the following table used to compute the tax payable by employees in certain organization

 

Gross Pay                                  Fewer than Three             Three or more

Dependents                        Dependents

KSh 10,000 or less                     Tax rate=0                          Tax rate=0

More than KSh10, 000 and

less than or equal to                   Tax rate=15%                     Tax rate = 10%

KSh20, 000

Over KSh20, 000                       Tax rate=35%                     Tax rate=25%

 

Write a C++ program inputs the gross pay and number of dependents of an employee and then computes the tax payable and net pay. The program should output gross pay, tax payable and the net pay of an employee in a suitable format.

Hint:

Tax payable  = Gross pay  * Tax rate
Net pay  = Gross pay  - Tax payable

 

#include 

using namespace std;
int main  (  )

{

int no_dep;

double gross_pay,tax_rate,tax_payable,net_pay; cout<<"Enter the Employee gross pay"<>gross_pay;

cout<<"Enter the number of dependants"<>no_dep;

if(gross_pay<=10000)
     tax_rate=0;

else if(gross_pay>10000 && gross_pay<=20000)
{

if(no_dep<3)

tax_rate=15.0/100.0;

else

tax_rate=10.0/100.0;

}

else
{

if(no_dep<3)

tax_rate=35.0/100.0;

else

tax_rate=

25.0/100.0;

}

tax_payable=gross_pay*tax_rate;

net_pay=gross_pay-tax_payable;

cout<<"Gross pay  ="<

cout<<"Tax payable  ="<

Posted Date: 8/21/2012 11:23:41 AM | Location : United States








Related Discussions:- Program to calculate gross pay and tax payable, Assignment Help, Ask Question on Program to calculate gross pay and tax payable, Get Answer, Expert's Help, Program to calculate gross pay and tax payable Discussions

Write discussion on Program to calculate gross pay and tax payable
Your posts are moderated
Related Questions
Define Enumeration in Computer Programming? Enumerated types enclose a list of constants that are able to be addressed in integer values. We can declare variables and types

Define a structure in C++: Write a program a structure in c++ program. void main() {                 struct player                 {                 char name[2

C and C++ require explicit dynamic memory management, using new and delete or malloc() and free(). It is helpful to understand where variables exist (usually the stack or the he

Rahul is a newbie to the programming and while learning the programming language he came to know the following rules: ???• Each program must start with ''{'' and end with '

What happens if you write following code? string& foo()

Question Write a program using c++ for the above function , at a= 1000, b=10 -3 ,10 -2 ,10 -4

overloadstream insertion opertator to display the data of object on the console

A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome

#padovan string in java   program in java // aakash , suraj , prem sasi kumar kamaraj college program 1 : package test.padovanstring; public class PadovanStrin

payment system, in c++ only..just use the printf or scanf.please