Tax reduction program

Write a C++ program

If the person is a landlord the rent collected is added to taxable income, the taxable income is reduced by the amount of donations to charity. If the person has children the taxable income is reduced by 500.00 for each child. The income tax due is 30% of the taxable income.

Input: annual pay,interest earned, rent, donations, number of dependent children
Output: Either the amount of tax due,or if the taxable income is zero or less, the statement NO TAX DUE.

Question is this right? This is my code



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
  Put the code you need help with here.

#include<iostream>
#include<iomanip>

using namespace std;

int main ()
{


	const double INTEREST_RATE = 0.30; 
	double tax, salary, donations, rent,num_child;
	

	
	cout <<" Enter Person's Salary" << endl;
	cin >> salary;
	
	
	
	cout << "Enter yearly rent amount:" <<endl;
	cin >> rent;
	


	cout << "Enter  yearly donation amount:" <<endl;
	cin >> donations;

	
	cout << "Enter number of children:" <<endl;
	cin >> num_child;
	

 
	
	if( salary <= 0.0)
		cout <<"No taxes are due at this time. " << endl;


	else
	
	

	cout << fixed << showpoint << setprecision(2);
	
	tax = INTEREST_RATE * salary - num_child * 500;
	
	
	cout << " Tax Due is : " << tax << endl;
	
	system("Pause");
	return 0;
	}




Question is this right? This is my code
If your code outputs what you want, then it is right
Last edited on
Topic archived. No new replies allowed.