char quitKey;
//Delay
cout << "Press any key and Enter to end program: ";
cin >> quitKey;
//End of Program
return 0;
}
//Function to display purchase amount
float getPurchaseAmount()
{
float purchaseAmount;
cout << "Enter the amount of purchase and press ENTER" << endl;
cin >> purchaseAmount;
//return result
return purchaseAmount;
}
// Function to Calculate state tax
float calculateStateTax(float purchaseAmount)
{
//Decxlare variables for state tax
float stateTax;
//Calculate State tax
stateTax = STATE_RATE * purchaseAmount;
//return result
return stateTax;
}
//Function to Calculate County tax
float calculateCountyTax(float purchaseAmount)
{
//Declare variables for county tax
float countyTax;
//Calculate County tax
countyTax = COUNTY_RATE * purchaseAmount;
//return result
return countyTax;
}
//Function to calculate total sales tax
float calculateTotalSalesTax(float stateTax, float countyTax)
{
float totalSalesTax;
//Calculate total sales tax
totalSalesTax = stateTax + countyTax;
// return result
return totalSalesTax;
}
// Function to calculate total sale
float calculateTotalSale(float totalSalesTax, float purchaseAmount)
{
float totalSale;
//Calculate total sale
totalSale = totalSalesTax + purchaseAmount;
// return result
return totalSale;
}
void showResult(float purchaseAmount, float stateTax, float countyTax, float totalSalesTax,float totalSale)
{
//Display all the purchase amount, state tax, county tax, total tax, and total of sale
cout << "Purchase amount = " << purchaseAmount << endl;
cout << "State tax = " << stateTax << endl;
cout << "County tax = " << countyTax << endl;
cout << "Total tax = " << totalSalesTax << endl;
cout << "Total of sale = " << totalSale << endl;
}
First of all, use code tags, see the button with <> on the right
The error message complains about the definition/implementation of showResult function:
In the definition you have void showResult (float purchaseAmount, float stateTax, float countyTax, float totalSalesTax);
In the implementation: void showResult(float purchaseAmount, float stateTax, float countyTax, float totalSalesTax,float totalSale)
Did you notice that the number of parameters is different?