//Jacklyn Isordia CSC5 Chapter 2, P. 81, #03
//
/**************************************************************
*
* Calculating the total cost with sales tax
* ____________________________________________________________
* This program computes the total sales tax on a $52 purchase.
* The program calculates the state sales tax and the county
* sales tax, then finds the toatl sales tax amount.
*
* Computation is based on the formula:
* State Tax = Purchase Amount x State Tax Rate
* County Tax = Purchase Amount x County Tax Rate
* Total Tax = State Tax + County Tax
* ____________________________________________________________
* INPUT
* purchaseAmount : cost of the purchase ($52)
* stateTaxRate : state sales tax rate (4%)
* countyTaxRate : county sales tax rate (2%)
*
* OUTPUT
* stateTax : amount of state tax
* countyTax : amount of county tax
* totalTax : total sales tax
*
**************************************************************/
#include <iostream>
using namespace std;
int main ()
{
float purchaseAmount;
float stateTaxRate;
float countyTaxRate;
float stateTax;
float countyTax;
float totalTax;
//
// Initialize Program Variables
purchaseAmount = 52;
stateTaxRate = 0.04;
countyTaxRate = 0.02;
//
// Compute Total
stateTax = purchaseAmount * stateTaxRate;
countyTax = purchaseAmount * countyTaxRate;
totalTax = stateTax + countyTax;
//
// Output Result
cout << "State Tax: " << stateTax << endl;
cout << "County Tax: " << countyTax << endl;
cout << "Total Sales Tax: " << totalTax << endl;
return 0;
}