Browse Source

Added display menu functionality

remotes/origin/feature
fdai7782 11 months ago
parent
commit
c9c5190662
  1. 18
      src/main/c/main_taschenrechner.c
  2. 2
      src/main/c/taschenrechner.h

18
src/main/c/main_taschenrechner.c

@ -6,7 +6,7 @@
int add(int a, int b) { int add(int a, int b) {
return a+b;
return a + b;
} }
int minus (int a, int b){ int minus (int a, int b){
@ -47,4 +47,20 @@ int mode(int userChoice){
} }
}
// display the mode options:
int displayMenu(){
printf("\nCalculator Modes: \n");
printf("\n1: Basic Mode\n");
printf("\n2: Scientific Mode (Trigonomertic functions, Logarithm and exponential functions.)\n");
printf("\n3: Graph Mode (Draw and visualize functions.)\n");
printf("\n4: Programming Mode (Binary , octal and hexadecimal )\n");
printf("\n5: Unit converter Mode (length, weight volume etc.)\n");
printf("\n0: Exit calculator\n");
return 1; // return 1 to check if the function works
} }

2
src/main/c/taschenrechner.h

@ -11,4 +11,6 @@ int divide(int a, int b);
int mode(int userChoice); int mode(int userChoice);
int displayMenu();
#endif // TASCHENRECHNER_H #endif // TASCHENRECHNER_H
Loading…
Cancel
Save