#include <iostream>
#include <cmath>
#include <iomanip>
#include <string>
using namespace std;
int main()
{
//Declaration of Variables
float TotalCollected; // Total Amount Collected from sales
double sales; // Sale excluding tax
float CountyTaxRate; // Tax rate for County
float StatesTaxRate; // Tax rate for state
cout << setprecision(2) << fixed << showpoint;
//We get data from the user
cout << "What is the Total Collected Amount? ";
cin >> TotalCollected;
cout << "What is the County Tax rate? ";
cin >> CountyTaxRate;
cout << "What is the State Tax rate ";
cin >> StatesTaxRate;
//Calculations
sales = TotalCollected / (1 + StatesTaxRate + CountyTaxRate);
//Output
cout << "Sales: $" << sales << endl;
return 0;
}
County tax rate= .02 state tax rate=.04
total collected amount= 26572.89
The output should be 25068.76 but I keep getting 25068.77.