//Xinnuo Wang CS1A chapter 3 , P.145, #12
//
/*******************************************************************************
*
* File Monthly Sales Tax Report
*-------------------------------------------------------------------------------
* This program asks to file a monthly sales tax report listing the sales for
* the month and the amount of sales tax collected
*
* computation is based on the formula:
* Sales = Total/ total sales taxes
* County sales tax = total * 4% of county sales tax
* State sales tax = total * 2% of state sales tax
*-------------------------------------------------------------------------------
* INPUT
* total : The total amount collected at the cash register
* month : The report for this month
* year : The report for this year
* taxes : The total taxes
* OUTPUT
* sales : The real sales out of taxes
* countySalesTax: The amount of couty slaes tax
* stateSalesTax : The amount of state slaes tax
* taxes : The total taxes
*******************************************************************************/
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
int main()
{
double total; //INPUT - The total amount collected at the cash register
string month; //INPUT - The report for this month
int year; //INPUT - The report for this year
double taxes; //INPUT - The total taxes
double sales; //OUTPUT - The real sales out of taxes
double countySalesTax; //OUTPUT - The amount of couty slaes tax
double stateSalesTax; //OUTPUT - The amount of state slaes tax
//
//Input Data
cout << "Enter the month" << endl;
cin >> month;
cout << "Enter the year" << endl;
cin >> year;
cout << "Enter the total amount: $" << endl;
cin >> total;
//
// Compute sales
sales = total / 1.06;
//
// Compute county sales tax
countySalesTax = sales * 0.04;
//
// Compute state sales tax
stateSalesTax = sales * 0.02;
//
// Compute total taxes
taxes = countySalesTax + stateSalesTax;
//
// Output Result
cout <<"Month: "<<month<<endl;
cout <<"--------------------"<<endl;
cout <<"Total Collected: $"<<setw(10)<<fixed<<setprecision(2)<<total<<endl;
cout <<"Sales: $"<<setw(10)<<fixed<<setprecision(2)<<sales<<endl;
cout <<"County Sales Tax: $"<<setw(10)<<fixed<<setprecision(2)<<countySalesTax<<endl;
cout <<"State Sales Tax: $"<<setw(10)<<fixed<<setprecision(2)<<stateSalesTax<<endl;
cout <<"Total Sales Tax: $"<<setw(10)<<fixed<<setprecision(2)<<taxes<<endl;
return 0;
}