answersLogoWhite

0


Best Answer

#include<iostream>

#include<string>

#include<sstream>

int main()

{

for (size_t employee=1; employee<=5; ++employee)

{

bool ok = false;

while (!ok)

{

std::string input;

std::cout << "Employee #" << employee << std::endl;

std::cout << "Enter basic pay: ";

std::getline (std::cin, input);

std::stringstream ss;

ss << input;

double pay;

if (ss >> pay)

{

double allowance = pay * 20 / 100;

double tax = (pay-allowance) * 30 / 100;

double nett = pay - tax;

std::cout << "Basic pay:\t" << pay << std::endl;

std::cout << "Allowance:\t" << allowance << std::endl;

std::cout << "Tax:\t\t" << tax << std::endl;

std::cout << "Nett:\t\t" << nett << std::endl;

ok = true;

}

else

{

std::cout << "Bad input\n";

}

}

std::cout << std::endl;

}

}

User Avatar

Wiki User

9y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you write code C plus plus program to compute nett salary for 5 employees given that the allowance is 20 percent of basic pay and income tax is 30 percent of the gross salary?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What BASIC program can compute and display all prime numbers from 1 to 40?

PRINT 2,3,5,7,11,13,17,19,23,29,31,37


Write a program in c plus plus to compute first of non-terminal?

there is no solution of this problem...........that's it..........


The distance between two cities in km is input through the keyboard write a program to convert and print this distance in meters feet inches and centimeters?

mesh's basic salary is input through the keyboard. his dearness allowance is 40% of basic salarying , and house rent allowance is 20% of basic salaried. write a program to calculate his gross salary


Write the full program for the quadratic equation in COBOL?

Identification division. Program-id. Quadratic. Environment division. Data division. Working-storage section. 01 a pic 9(3) value 0. 01 b pic 9(3) value 0. 01 c pic 9(3) value 0. 01 d pic 9(3) value 0. 01 e pic 9(3) value 0. 01 f pic 9(3) value 0. 01 g pic 9(3) value 0. 01 h pic 9(3) value 0. 01 x1 pic 9(3) value 0. 01 x pic z(3).z(2) value 0. 01 x2 pic 9(3) value 0. 01 y pic z(3).z(2) value 0. Procedure division. Display "Written by Martin O. Egua, but not complete". Display "Quadratic equation solver for three values a, b &amp; c" Display "Enter a number: " Accept a. Display "Enter the second number: " Accept b. Display "Enter the last number: " Accept c. compute d = (b * b) compute e = 4 * a * c compute f = 2 * a compute g = d - e compute h = function sqrt (g). compute x1 = (-b) + h compute x = x1 / f Display "X = " x compute x2 = (-b) - h compute y = x2 / f Display "Y = " y Display "Send the accurate program". Stop run.


How do you design a bonus structure?

A bonus structure is a program that rewards employees when they have done good, or met certain goals. A share of increased sales could be awarded, or money could be given out to the employees with new ideas. It is all about what type of business is being run, and what the employees can do to make it the most profitable.

Related questions

What was Betsy Bernard's Emerging Leaders Program?

in 2000 she established the Emerging Leaders Program at AT and T, 60 percent of its members were women. The intent of the program was to provide mentoring for management employees.


What is the verb for computer?

The verb for computer is compute.Other verbs are computes, computing and computed."I am computing"."We have computed the program""I like to compute".


Where might one find information about the Australian Youth Allowance program?

One can find information about the Australia Youth Allowance program on the 'youth.gov' website. There is also information on the 'Australian Apprenticeships' website.


Write a pascal program that compute an area of a triangle?

{A program to compute the area of a triangle} {by Ogboin W. Meshach} Var; b,h:real; BEGIN Writeln('Triangle'); Write('Base: '); Readln(base); Write('Height: '); Readln(height); area:=0.5*base*height; Writeln('Area: ', area :0:2); End.


Are Head Start program employees federal employees?

The federal government provides grants for the programs, but the employees are not federal employees.


Write a c program to find Volume and surface area of cube?

Write a c program to compute the surface area and volume of a cube


Design and develop a simple application program that will compute the sum of two numbers?

This isn't a question!


What BASIC program can compute and display all prime numbers from 1 to 40?

PRINT 2,3,5,7,11,13,17,19,23,29,31,37


How does Kroger's training program work?

The Kroger training program is actually quite a simple and straight forward program. Kroger employees train new employees how to do their job.


What is the trade readjustment act?

Trade Readjustment Allowance or TRA is a special program by the federal government to keep the workers who were affected by the increase in imports. They can be qualified for reemployment services, training, job search allowance, and relocation allowance.


Does Runescape use up download allowance?

Of course it does. ANY program that connects over the Internet will use up your download allowance - some more than others.


What represents how employees can support the Program Management function of the Army Safety Program?

Employees can support the Safety Program Management Function of the Army Safety Program by reviewing safety posters and other campaign materials.