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

Assignment Help:

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  ="<

C, Write a program to find the area under the curve y = f(x) between x = a ...

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b

Tracing of abstract array - c++ program, Tracing of Abstract array: i...

Tracing of Abstract array: inline int isZero( const Object& o ) {     return o == NOOBJECT; }   int AbstractArray::isEqual( const Object& obj ) const {

Arithmetic operation, a program that declares and prompts the user to enter...

a program that declares and prompts the user to enter two integer and performs the five arithmetic operations

Application for tag in the forest game, Your program should use the Free Pa...

Your program should use the Free Pascal compiler or the Lazarus IDE described in CSC 540. When you hand in your assignment to the digital dropbox, it should be a .PAS file, not zip

Explain structures, Structures A structure is a derived data type. It i...

Structures A structure is a derived data type. It is a combination of logically related data items. Unlike arrays, which are a collection of such as data types, structures can

Minimum total number of shelves, At a shop of marbles, packs of marbles are...

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

Data structyres, What data structure would you mostly likely see in a nonre...

What data structure would you mostly likely see in a nonrecursive implementation of a recursive algorithm?Minimum 100 words accepted#

Developing programs in the c++ programming language., I. COURSE DESCRIPTION...

I. COURSE DESCRIPTION Develops a working knowledge of object-oriented concepts in areas of classes, inheritance, data structures, error handling, templates and file processing.

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd