//Natalie Zarate CIS5 Chapter 3, P. 145, #12
/*******************************************************************************
*
* COUMPUTE SALES TAX
* _____________________________________________________________________________
* This program will accept as input the month, year,and amount of sales tax
* collected and will compute sales, the county and state sales tax, and the
* total sales tax.
*
* Computation is based on the formula:
*
* product sales = total income / 1.06
*
* And the assumption that the state tax rate = 4%, the county tax rate = 6% and
* the total amount collected at the cash register = $26572.89
* _____________________________________________________________________________
* INPUT
* month : The month of the year this computation is based in
* year : The year this compuation is based in
* totalAmnt : The total amount collected at the cash register
* (sales + sales tax)
* stateTax : Tax rate levied by the sate
* countyTax : Tax rate levied by the county
*
* OUTPUT
* salesT : totalAmnt / 1.06
* csalesT : total sales tax collected by county
* sSalesT : total sales tax collected by state
* totalsT : total sales tax collected
*
******************************************************************************/
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
int main()
{
string month; // INPUT - The month of the year this
// computation is based in
int year; // INPUT - The year this compuation is based in
float totalAmnt = 26572.89; // INPUT - The total amount collected at the
// cash register (sales + sales tax)
float stateTax = 0.04; // INPUT - Tax rate levied by the state
float countyTax = 0.02; // INPUT - Tax rate levied by the county
float salesT; // OUTPUT - totalAmnt / 1.06
float csalesT; // OUTPUT - sales tax collected by county
float sSalesT; // OUTPUT - sales tax collected by state
float totalsT; // OUTPUT - total sales tax collected
// Prompt user for year and display
cout << "Year: ";
cin >> year;
cout << year <<endl;
// Prompt user for month and display
cout << "Month: ";
cin >> month;
cout << month <<endl;
// Seperate from tax information
cout << "--------------------" << endl;
// Display total collected
cout << "Total Collected: " << setw(6) << "$ ";
cout << setprecision(2) << fixed << totalAmnt << endl;
// Compute and display total sales
salesT = totalAmnt / 1.06;
cout << "Sales: " << setw(16) << "$ " << setw(8) << salesT << endl;
// Compute and display sales tax collected by county
csalesT = salesT * countyTax;
cout << "County Sales Tax: " << setw(5) << "$ ";
cout << setw(8) << csalesT << endl;
// Compute and display sales tax collected by state
sSalesT = salesT * stateTax;
cout << "State Sales Tax: " << setw(6) << "$ ";
cout << setw(8) << sSalesT << endl;
// Compute and display total sales tax
totalsT = csalesT + sSalesT;
cout << "Total Sales Tax: " << setw(6) << "$ ";
cout << setw(8) << totalsT;
return 0;
}