Question
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
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started