Welcome to Dream.In.Code
Become a C++ Expert!

Join 137,425 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,944 people online right now. Registration is fast and FREE... Join Now!




Tax Calculator

 
Reply to this topicStart new topic

Tax Calculator

neogentrader
19 Jan, 2008 - 08:20 AM
Post #1

New D.I.C Head
*

Joined: 19 Jan, 2008
Posts: 1

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
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 12/5/08 04:40AM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month