Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- */
- #include<iostream>
- #include<cmath>
- #include<iomanip>
- #include<string>
- using namespace std;
- int main()
- {
- // Declare variables
- string month, year;
- double t, s, c, state, totax;
- // Get information
- cout << "Monthly Sales Tax\n\n";
- cout << "Please Enter Month\n";
- cin >> month;
- cout << "Please Enter Year\n";
- cin >> year;
- cout << "Please Enter Total Amount From Register\n";
- cin >> t;
- // calculate
- s = (t / 1.06);
- totax = (t - s);
- c = (s * 0.02);
- state = (s * 0.04);
- //results
- cout << "Month: " << month << " / Year: "<< year <<endl;
- cout << setprecision(2) << fixed;
- cout << "--------------------\n\n";
- cout << "Total Collected: $" << t << endl;
- cout << "Sales: $" << s << endl;
- cout << "County Sales Tax: $" << c << endl;
- cout << "State Sales Tax: $" << state << endl;
- cout << "Total Sales Tax: $" << totax << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement