1. ## simple tax program

Pretty simple program.
The program runs fine.
Do you think the program is acceptable considering the parameters set by the instructions?

Create a small program based on the following

// encourage the use of user-defined functions
// (calculates different sales tax based on an item price)

1. Ask the user to enter the price of an item.
2. Get the item price from the user.
3. Calculate the sales tax of the item:
- 7% if the item costs less than \$200.
- 5% if the item costs \$200 or more.
4. Display the original item price and sales tax amount onto the screen.
5. Calculate new cost of the item with the sales tax.
6. Display the total price of the item onto the screen.

Code:
```#include<stdio.h>
#include<math.h>

double getPrice(void);

int main(void){

double price = 0.0;
double sevenP = 0.0;
double fiveP = 0.0;

printf("PLease enter the price of the customers purchase:\t\$");
price = getPrice();
printf("The price is:\t \$ %.2lf\n", price);

sevenP = price * .07;
fiveP = price * .05;

if (price < 200){
printf("The federal tax is: \$ %.2lf\n", sevenP);
printf("The price plus the federal tax is: \$ %.2lf\n", sevenP + price);
}else{
printf("The state tax is: \$ %.2lf\n", fiveP);
printf("The price plus the state tax is: \$ %.2lf\n", fiveP + price);
}
return 0;
}
double getPrice(void){

int value = 0;
scanf_s(" %d", &value);
return value;
}```

2. When I did programming at Uni, we lost marks for poor indentation

Choose one of these and stick to it Indent style - Wikipedia, the free encyclopedia

You appear to be learning 1TBS - Just make sure your code only indents when you use a curly brace.

Also, I would only calculate sevenP if the input was below 200 and vice versa.

3. i tend to use GNU, but instead of spaces, i use tab

4. Code:
```    double price = 0.0;

// ...

printf("PLease enter the price of the customers purchase:\t\$");
price = getPrice();```
Getting the price (as a double), fine.

Code:
`double getPrice(void);`
This function gets and returns a price (as a double). Fine.

Code:
```double getPrice(void){

int value = 0;
scanf_s(" %d", &value);
return value;
}```
... So why are you reading the value into an int and returning that?

--------

Oh, and you might want to consider following the rules of orthography (i.e. "Please" instead of "PLease").