Create the following 4- function C++ program: A family can claim $1000 tax credit per child, but the total child tax credit cannot exceed $4000. Recently the tax law has changed. The $4000 upper limit applies only if the family income exceeds $70,000. In other words, families with income more than $70,000 can claim $4000 child tax credit at the most, but families with income $70,000 or less can claim more than $4000 child tax credit if there are more than 4 children ($1000 credit per child). Write a new program to calculate child tax credit. In addition to main(), also use the following two functions in your program:
getnumChildren() : a value-returning function that asks for the number of children. Use a return statement to send it to main().
getIncome() : a value-returning function that asks for the family income. Use a return statement to send it to main().
calcCredit() : a value-returning function that calculates and returns child tax credit to main().
The main() function should display the total tax credit on the computer screen.
#include <iostream>
#include <iomanip>
using namespace std;
//onst int family_claim_perchild = 1000;
int getnumChildren()
{
int numChildren = 0;
cout << "How many children do you have? ";
cin >> numChildren;
//cout << endl;
return numChildren;
}
int calCredit(int numChildren, double income)
{
int totCredit = 0;
totCredit = numChildren * 1000;
if (income > 70, 000)
{
if (totCredit > 4000)
{
totCredit = 4000;
//return totCredit;
}
}
//totCredit = numChildren * 1000;
return totCredit;
}
double getIncome()
{
double income = 0.0;
cout << "Enter your yearly income: ";
cin >> income;
return income;
}
int main()
{
double totCredit = 0.0;
int numChildren = 0;
double income = 0.0;
numChildren = getnumChildren();
income = getIncome();
totCredit = calCredit(numChildren, income);