summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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: