fork download
  1. #include <string>
  2. #include <iostream>
  3. #include <iomanip>
  4. using namespace std;
  5. int main()
  6. {
  7. string month;
  8. int year;
  9. double total;
  10. cout << "Please enter a month: ";
  11. getline(cin,month);
  12. cout << "Please enter the year: ";
  13. cin >> year;
  14. cout << "Please enter the total amount collected at the cash register";
  15. cin >> total;
  16. double sales=total/1.06;
  17. double countyTax=sales*0.02;
  18. double stateTax=sales*0.04;
  19. double totalTax=countyTax+stateTax;
  20. cout << "Month: " << month << endl;
  21. cout << "--------------------" << endl;
  22. cout << "Total collected:" << setw(10) << "$" << sales;
  23. return 0;
  24. }
Success #stdin #stdout 0s 3472KB
stdin
Standard input is empty
stdout
Please enter a month: Please enter the year: Please enter the total amount collected at the cash registerMonth: 
--------------------
Total collected:         $5.6904e+103