diff options
author | Skiz <skiznet@aol.com> | 2024-09-15 17:15:59 -0400 |
---|---|---|
committer | Skiz <skiznet@aol.com> | 2024-09-15 17:15:59 -0400 |
commit | 6b9f65b9211918ebc4b91b339bbe9a35ec8c6b1e (patch) | |
tree | e962fc57d004e16a2b3c6f425cfefb6269e0b329 /src | |
parent | ef2e056301767585b13804fadd2bbfa420743284 (diff) |
Made config file, to set custom percentage
Diffstat (limited to 'src')
-rw-r--r-- | src/config.c | 5 | ||||
-rw-r--r-- | src/main.c | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/config.c b/src/config.c new file mode 100644 index 0000000..ee0b3f4 --- /dev/null +++ b/src/config.c @@ -0,0 +1,5 @@ +// The config file for the TaxC program. +// Change the var to your state's tax percentage. +// Example for the state of Pennsylvania: 0.06 + +float percent = 0.06; @@ -1,6 +1,7 @@ #include <stdio.h> #include <stdlib.h> #include <math.h> +#include "config.c" // Definitions: #define lessthan < #define print printf @@ -14,7 +15,7 @@ int main(int argc, char* argv[]) { // Does tax math: float numInput = atof(input); float tax = numInput * 0.06; - float total = numInput + tax; + float total = numInput + percent; total = round((total * 100)) / 100; // Prints total to terminal: |