// taxable.cpp
// Compute taxable income.

#include <iostream>

using namespace std;

void get_income_exemptions (float &, int &);


int main() {

  float income, taxable_income;
  int exempts;

  cout << "Welcome to the taxable income calculation program." << endl;

  get_income_exemptions(income,exempts);

  taxable_income = income - 3000 - exempts * 1000;

  cout << "Your taxable income is: " << taxable_income << endl;
}




//*********************************************************************
// Input gross income and valid number of exemptions.

void get_income_exemptions (float &gross, int &exemptions) {

  cout << "Enter gross income: ";
  cin >> gross;

  cout << "Enter number of exemptions: ";
  cin >> exemptions;
  while (exemptions < 0 || exemptions > 12) {
    cout << "Error.  Exemptions must be between 0 and 12.  Reenter: ";
    cin >> exemptions;
  }
}




