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

Specifying a Class: As discussed a class is defined to develop an algorithm and bind it together in a core shell. A class is an abstract data type (ADT).  The binding of dat

i want software to calculate heating or use thermodynamic equation , pleas help me

The goto statement This statement can be used to branch to another statement of the program. This is rarely used as it violates the principle of structured programming. Though

At a shop of marbles, packs of marbles are prepared. Packets are named A, B, C, D, E …….. All packets are kept in a VERTICAL SHELF in random order. Any numbers of packets with thes

Optimized NIC Driver for Windows Compact 7 for Hard Real Time Communication Project Description: I am seeking an optimized driver (miniport driver) that will be used for sele

FIT 3042 System Tools and Programming Languages Semester 1 2013 Assignment 1 An SDL video player for a custom video format Worth: 20% of final mark. Must be completed individually

Smugglers are becoming very smart day by day. Now they have developed a new technique of sending their messages from one smuggler to another. In their new technology, they are send

hello i have about 15 hours the dead line I Need a program in c language that''s determine the router ip or the gateway ip of the current NIC example the router ip is: 192.168.1.1

In this sub-task will you implement three functions for the final three function prototypes that will do exactly the same as the three functions that you have just written. This ti