From 6b9f65b9211918ebc4b91b339bbe9a35ec8c6b1e Mon Sep 17 00:00:00 2001 From: Skiz Date: Sun, 15 Sep 2024 17:15:59 -0400 Subject: Made config file, to set custom percentage --- src/config.c | 5 +++++ src/main.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 src/config.c (limited to 'src') 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 #include #include +#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: -- cgit v1.2.3