//Grace Fermelia CS1A Chapter 2, P. 81, #3
//
/**************************************************************
*
* COMPUTE SALES TAX
* ____________________________________________________________
* This program computes total sales tax for a purchase based on purchase total
* and precents for sales taxes and displays the result.
*
* Computation is based on the formulas:
* state_Tax = state_Percent x purchase
* county_Tax = county_Percent x purchase
* sales_Tax = state_Tax + county_Tax
* ____________________________________________________________
* INPUT
* purchase : Total amount spent (USD) not including tax
* state_Percent : Percent of state tax as decimal
* county_Percent : Percent of county tax as decimal
*
* OUTPUT
* state_Tax : amount (USD) of state tax
* county_Tax : amount (USD) of county tax
* sales_Tax : Total sales Tax (USD)
*
**************************************************************/
#include <iostream>
#include <iomanip>
using namespace std;
int main ()
{
double purchase; //INPUT -Total amount spent (USD) not including tax
double state_Tax; //OUTPUT -amount (USD) of state tax
double state_Percent; //INPUT -Percent of state tax as decimal
double county_Tax; //OUTPUT -amount (USD) of county tax
double county_Percent;//INPUT -Percent of county tax as decimal
double sales_Tax; //OUTPUT -total sales Tax (USD)
// Initialize Program Variables
purchase = 52;
state_Percent = .04;
county_Percent = .02;
// Compute state_Tax
state_Tax = state_Percent *purchase;
// Compute county_Tax
county_Tax = county_Percent * purchase;
// Compute sales_tax
sales_Tax = state_Tax + county_Tax;
// Output Result
cout << "The Sales Tax is $"<< sales_Tax <<endl;
return 0;
}