SOURCE FILE: 020_taxProg0.cpp



/* 
      This program calculates a flat tax of 1%
*/

/* ****************************** */

#include <iostream> 
using namespace std ; 

int main (void) 
{
  double income, tax ;

  cout << "\nPlease enter your taxable\n" ;
  cout << "income as a non-negative number: " ;
  cin >> income ;
  
  if (income < 0)
  { /* Error Message */

     cout << "\nYou entered a BAD VALUE for your income.\n" ;
     cout << "Please run the program again.\n\n" ;
  }
  else 
  { /* Figure and report the tax. */

     tax = 0.01 * income ;
   
     cout.setf (ios::fixed) ;
     cout.setf (ios::showpoint) ;
     cout.precision (2) ;

     cout << "\nYour taxable income is: " << income << endl ;
     cout << "For filing status Single your tax is: " << tax ;
     cout << endl << endl ;
  } 
  return 0; 
}

/* ****************************** */