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

Explain about evaluation of expression in c language, Explain about Evaluat...

Explain about Evaluation of Expression in c language? An Expressions are evaluated using an assignment statement of the form: variable = expression; The Variable is any v

Describe overloading??, A: Along with the C++ language, you can overload op...

A: Along with the C++ language, you can overload operators and functions. Overloading is the practice of supplying more than one definition for a provided function name in the same

Described overriding?, In order to override a method, a subclass of the cla...

In order to override a method, a subclass of the class which originally declared the method have to declare a method along with the same name, return type (or a subclass of that re

Super ASCII string cost, string will contain only lower case alphabet& the ...

string will contain only lower case alphabet& the ascii value starts from 1-26,(ie,a=1&z=26).it perform the operation like the following costs:add=2units,replace=1unit,delete=3unit

#padovan string in c , #padovan string in java   program in java /...

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

Define storage classes of c program - computer programming, Define Storage ...

Define Storage Classes of c program - computer programming? Each variable and function in C language has two attributes that are type and storage class. If storage class of a v

Program to define simulation method, This problem familiarizes you with usi...

This problem familiarizes you with using random numbers in C++. The program is to compute a good approximation of π using a simulation method called "Monte Carlo". The following fi

VS Project, Hi, I want to get rtsp source for windows

Hi, I want to get rtsp source for windows

#title., #quGiven the Array class definition in Fig. 11.10-11.11 (pp. 476-4...

#quGiven the Array class definition in Fig. 11.10-11.11 (pp. 476-479) of the textbook, write a new overloaded operator function for the ‘%’ (modulus) operator (i.e., return an arra

Write a program to define a matrix, Write a program to define a matrix: ...

Write a program to define a matrix: 1. Write a function that takes an integer and calculates and returns the factorial of the integer. The Factorial of a number "n" is compute

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