Tax program help

The goal of my program was to be used to calculate the federal tax. The tax is calculated as follows: For single people, the standard exemption is $4,000; for married people, the starnd exemption is $7,000. Program must consist of at least the following functions:
a.) Function getData: this function asks the user to enter relevant data
b.) Function taxAmount: this function computes and returns the tax owed.
This is what I have so far but seem to have a little problem as the program doesn't run. Can anyone please help me getting this running?

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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#include "stdafx.h"
#include <iostream>
#include <cmath>
#include <string>
#include <iomanip>

using namespace std;

int getData(int exem1);

int taxAmount;

int status1;

int kids1;

int income;

int pension;

int main()
{

	cout << "This program is meant to help you calculate your federal taxes" << endl; 
		
	cout <<	"depending on a few little bits of information you provide."<< endl;

	cout << "Please enter a number for your marital status. " << endl;

	cout << "1 for single," " 2 for married" << endl ;
	
	cin >> status1;
	
	cout << "You have entered:" <<status1<< endl;

	
		if(status1 == 1)
			cout << "You are single";
			
		else if (status1 == 2){
			cout << "You are married. How many children under 14 do you have in your household?";
			cin >> kids1;
		}
		else {
			cout << "That is an invalid entry.";
		
		}
	cout << "\n Please enter your taxable income:";
	int getData(int exem1);
	cin >> income;

	cout << "Enter the amount of gross income contributed to a pension fund:";
	cin >> pension;

system ("pause");
return 0;
}

int getData(int exem1)
{
	while(income){
	if (status1 == 1 ){
		(cout << "Single Exemption is $4,000.");
		return exem1 = 4000 + 1500;}

	else if (status1 == 2){
		(cout << "Married Exemption is $7,000.");
		return exem1 = 7000 + 3000;}

	else (kids1 <=2);{
		(cout << "Married couple with 2 or more children under the age of 14 exemption is $6,000.");
		return exem1 = 6000 + 3000 + 1500*kids1;}
	}
		return 0;

}

	
Topic archived. No new replies allowed.