I am trying to convert a previous code i did.
CODE
/*Tax Calculator Program*/
#include <stdio.h> /* Include file that contains C I/O functions */
main()
{
/*Declare variables*/
float fltDelMarTax = 0.00;
float fltEncinitasTax = 0.00;
float fltLaJollaTax = 0.00;
/*Initialize variables*/
float fltDelMarTaxRate = 7.25;
float fltEncinitasTaxRate = 7.50;
float fltLaJollaTaxRate = 7.75;
float fltPurchaseAmount = 125.00;
/*Calculate tax for DelMar*/
fltDelMarTax = (fltDelMarTaxRate * .01 * fltPurchaseAmount);
/*Calculate tax for Encinitas*/
fltEncinitasTax = (fltEncinitasTaxRate * .01 * fltPurchaseAmount);
/*Calculate tax for LaJolla*/
fltLaJollaTax = (fltLaJollaTaxRate* .01 * fltPurchaseAmount);
/*Print results to screen*/
printf ("This is the sales tax for a $125.00 purchase for each of the 3 locations.\n\n");
printf ("\nTax for Del Mar (Rate of 7.25) - $%.2f",fltDelMarTax);
printf ("\nTax for Encinitas (Rate of 7.50) - $%.2f",fltEncinitasTax);
printf ("\nTax for LaJolla (Rate of 7.75) - $%.2f",fltLaJollaTax);
/*Keep screen open*/
fflush(stdin);
/*Press key to close screen*/
printf("\n\nPress any key to end.");
getche();
}
/*End Tax Calculation*/
I am noe trying to do this so the user can input a certain purchase price and receive a display of the total price of all three of the differrent locations.
*mod edit - added code tags