I'm writing a simple program in C++ to calculate the tax for a purchase and output it. My code is outputting the text and the variables that are set and not changed. But instead of outputting the variables that are being calculated and set based on the tax rates it just outputs 0. Thanks for any help! First week of class for me so try to dumb it down if you can :)
Here's the code:
#include <iostream>
using namespace std;
int main()
{
int price = 52, stateTaxRate = 4, countyTaxRate = 2;
double stateTax = price / 100 * stateTaxRate;
double countyTax = price / 100 * countyTaxRate;
double totalTax = countyTax + stateTax;
double total = price + totalTax;
cout << "State Tax: " << stateTax << " ";
cout << "County Tax: " << countyTax << " ";
cout << "Total Tax: " << totalTax << " ";
cout << "Total: " << total << " ";
}