#include <iostream>
#include <iomanip>
#include <string>
usingnamespace std;
void main()
{
//This program will help file and list monthly sales tax
string month;
int year;
double collection;
double sales;
double totalTax;
double SaleTaxState;
double SaleCountyTax;
constdouble StateTax=0.04;
constdouble CountyTax=0.02;
cout<<fixed<<showpoint<<setprecision(1)<<endl;
cout<<"This is a Monthly Sales Tax Program. Please enter the month.\n";
cin>>month;
cout<<"Enter the year. \n";
cin>>year;
cout<<"What is the total amount you have collected in your register? \n";
cin>>collection;
sales=collection-totalTax;
totalTax=SaleCountyTax+SaleTaxState;
SaleCountyTax=(sales*CountyTax)-sales;
SaleTaxState=(sales*StateTax)-sales;
cout<<"Month: "<<month<<setw(6)<<year<<endl;
cout<<"---------------------- \n";
cout<<"Total Collected: "<<setw(9)<<collection<<endl;
cout<<"Sales: "<<setw(9)<<sales<<endl;
cout<<"County Sales Tax: "<<setw(9)<<SaleCountyTax<<endl;
cout<<"State Sales Tax: "<<setw(9)<<SaleTaxState<<endl;
cout<<"Total Sales Tax"<<setw(9)<<totalTax<<endl;
}
I can't really point out why the variable after my cin>>collection (including collection) are not being initialized, therefore not letting me run my program? Anyone notice the problem?
Ok, I need to work this out on paper(web paper) because it looks like you got yourself into a paradox here. NOTE: This is not in the order you need to calculate in a program.