summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSkiz <skiznet@aol.com>2024-09-15 17:15:59 -0400
committerSkiz <skiznet@aol.com>2024-09-15 17:15:59 -0400
commit6b9f65b9211918ebc4b91b339bbe9a35ec8c6b1e (patch)
treee962fc57d004e16a2b3c6f425cfefb6269e0b329
parentef2e056301767585b13804fadd2bbfa420743284 (diff)
Made config file, to set custom percentage
-rw-r--r--src/config.c5
-rw-r--r--src/main.c3
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;
diff --git a/src/main.c b/src/main.c
index 04d4b09..afd81de 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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: