I am trying to write my first program to calculate a 6% sale tax on a purchase. i need help setting up the variable and calculation
Printable View
I am trying to write my first program to calculate a 6% sale tax on a purchase. i need help setting up the variable and calculation
Show us what you've done so far, so that we can guide you.
You need a variable with a cost in it.
You need to multiply that by 0.06 and then add to said variable.
Questions?
Now you have the idea. Post some code. You have to try to do this yourself!!!
Mr. C.
Psuedo codeCode:#include <stdio.h>
int main ( void )
{
Setup a variable for price of purchase
Setup a variable for purchase total
Ask for input; the price of the purchase, and store it in the variable
Multiply the purchase variable * .06, and store the answer in the variable total
Print the variable total
return 0;
}