diff --git a/src/main/c/main_taschenrechner.c b/src/main/c/main_taschenrechner.c index 74668c7..d4549dc 100644 --- a/src/main/c/main_taschenrechner.c +++ b/src/main/c/main_taschenrechner.c @@ -20,3 +20,31 @@ int multiply(int a, int b) { int divide(int a, int b) { return a / b; } + +int mode(int userChoice){ + + switch(userChoice) { + + case 1:return 1; // Basic mode + break; + + case 2:return 2; // Scientific mode (Trigonomertic functions, Logarithm and exponential functions.) + break; + + case 3:return 3; // Graph mode (Draw and visualize functions.) + break; + + case 4:return 4; // Programming mode (Binary , octal and hexadecimal ) + break; + + case 5:return 5; // Unit converter mode (length, weight volume etc.) + break; + + case 0: return 0; // printf("Exiting the calculator.\n"); + break; + + default: return -1; // printf("Invalid choice. Please try again.\n"); + + } + +} \ No newline at end of file diff --git a/src/main/c/taschenrechner.h b/src/main/c/taschenrechner.h index 3147d9d..d410b22 100644 --- a/src/main/c/taschenrechner.h +++ b/src/main/c/taschenrechner.h @@ -9,4 +9,6 @@ int multiply(int a, int b); int divide(int a, int b); +int mode(int userChoice); + #endif // TASCHENRECHNER_H