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?
#include "stdafx.h"
#include <iostream>
#include <cmath>
#include <string>
#include <iomanip>
usingnamespace 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";
elseif (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;}
elseif (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;
}