I have undeclared variables please read

basically my tax1-6 variables will not work#include <iostream>
#include <string>
#include <iomanip>
using namespace std;
const double FederalIncomeTax = 0.15;
const double StateTax = 0.035;
const double SocialSecurityTax = 0.0575;
const double MedicaidTax = 0.0275;
const double PensionPlan = 0.05;
const double HealthInsurance = 75;
int main()
{

double GrossPay;
double NetPay;
Tax1 = GrossPay * FederalIncomeTax;
Tax2 = GrossPay * StateTax;
Tax3 = GrossPay * SocialSecurityTax;
Tax4 = GrossPay * MedicaidTax;
Tax5 = GrossPay * PensionPlan;
Tax6 = GrossPay * HealthInsurance;

string Name;

cout << "Input name of employee" << endl;
cin >> Name;

cout << "Input amount " << Name << " earned in $" << endl;
cin >> GrossPay;

cout << fixed << setprecision (2)
cout << "Federal income tax cost: " << GrossPay * FederalIncomeTax = Tax1 << "$" << endl;

cout << "State income tax cost: " << GrossPay * StateTax = Tax2 << "$" << endl;

cout << "Social security tax cost: " << GrossPay * SocialSecurityTax = Tax3 << "$" << endl;

cout << "Medicaid tax cost: " << GrossPay * MedicaidTax = Tax4 << "$" << endl;

cout << "Pension plan cost: " << GrossPay * PensionPlan = Tax5 << "$" << endl;

cout << "Health insurance cost: " << HealthInsurance = Tax6 << "$" << endl;
cout << "Netpay" << GrossPay - (Tax1 + Tax2 + Tax3 + Tax4 + Tax5 + Tax6) << "NetPay";



system("pause>nul");
return 0;
}
And the error states that tax 1-6 are undeclared what do i do to fix it
Last edited on
And the error states that tax 1-6 are undeclared what do i do to fix it

Declaring them sounds like a fabulous idea.
Topic archived. No new replies allowed.