Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help in c++ please 1- modify the program to prompt a user for the salary the prompt should tell the user to enter

I need help in c++ please

1- modify the program to prompt a user for the salary the prompt should tell the user to enter -1 when there are no more employees

2- modify the program to accept the user input for salary

3- modify the program to prompt a user input for numDependents

4- modify the program to accept the user input for numDependents

5- add a while loop that will accept an unlimited number of employees and run until the user enters a salary of -1

6- compile and run the program

here is the code

#include using namespace std; int main() { double salary = 1250.00; double stateTax; double federalTax; double numDependents = 2; double dependentDeduction; double totalWithholding; double takeHomePay;

cout << "State Tax: $" << stateTax << endl; stateTax = salary * 0.55; cout << "state Tax : $" << stateTax << endl;

cout << "Federal Tax: $" << federalTax << endl; federalTax = salary * 0.21; cout << "Federal Tax : $" << federalTax << endl;

cout << "Dependents: $" << dependentDeduction << endl; dependentDeduction = ( salary * 0.35) * numDependents; cout << "Dependents : $" << dependentDeduction << endl;

// Calculate Total withholding totalWithholding = stateTax + federalTax;

// Calculate take-home pay here takeHomePay = salary - totalWithholding + dependentDeduction; cout << "Salary : $" << salary << endl; cout << "Take-Home Pay: $" << takeHomePay << endl; return 0; }

4-

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Database Programming With Visual C# .NET

Authors: Ying Bai

1st Edition

0470467274, 978-0470467275

Students also viewed these Databases questions

Question

Describe Table Structures in RDMSs.

Answered: 1 week ago