00:01
Hello student, this code first declare the variable salary, num dependents, state tax, federal tax, dependent deduction, total withholding.
00:10
Then it calculate the state tax, federal tax, dependent deduction, total withholding.
00:16
Finally it print the result.
00:18
So here is a c+ + code to calculate the amount of the tax with help from an employee's weekly salary, the tax deduction to which the employee is entitled for each dependents and the title take home pay.
00:31
So here c+ + code is written here.
00:34
So i have taken the file hash include iostream using namespace standard int main declares the variable here, the variable here is salary which is $1250 and number of dependents int num dependents variable is taken.
00:52
So here number of dependents is 2.
00:54
Now calculate the state tax.
00:56
So i have taken the variable double state tax.
01:01
So salary salary into .065 because 6 .5 % is the state tax.
01:09
That's why i have multiplied it by .065.
01:14
So it will give the state tax if i multiply the salary by .065.
01:19
Now calculate the federal tax.
01:22
So federal tax is here 28 % of the salary.
01:27
So here i have taken the variable double federal tax.
01:31
So it is calculated by salary into .28.
01:36
So it will give the federal tax.
01:38
Now calculate the dependent deduction.
01:40
I have taken here the number of the dependents 2.
01:44
So here double type of dependent deduction variable i have taken.
01:48
So it is given 2 .5 % of the employee employee salary of each dependents.
01:54
Here i have taken the two dependents.
01:56
So num dependent variable multiplied by salary multiplied by .025 because 2 .5 % deduction.
02:04
Now calculate the total withholding.
02:08
So for this i have taken the variable double total withholding.
02:12
So for this i have calculated i have to add three things state tax plus federal tax plus dependent deduction.
02:20
So it will give us the total withholding.
02:23
Now calculate the take home pay.
02:27
So for this i have taken the variable double take home pay...