|
@ -1,24 +1,31 @@ |
|
|
#include "displayMenuCalculator.h" |
|
|
#include "displayMenuCalculator.h" |
|
|
|
|
|
|
|
|
|
|
|
// Note: |
|
|
|
|
|
/* This Function may or may not be implemented in actual program, even if it is merged to the main branch. |
|
|
|
|
|
If it is temporarily not included in the main Program, then this has a role in future Development of the Project */ |
|
|
|
|
|
|
|
|
int check() |
|
|
int check() |
|
|
{ |
|
|
{ |
|
|
if(a == 1) |
|
|
|
|
|
{ |
|
|
|
|
|
return 1; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if(a == 1) |
|
|
|
|
|
{ |
|
|
|
|
|
return 1; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void displayMenuCalculator(char x) |
|
|
void displayMenuCalculator(char x) |
|
|
{ |
|
|
{ |
|
|
if(x == 'c') |
|
|
|
|
|
{ |
|
|
|
|
|
if(check() == 1) |
|
|
|
|
|
{ |
|
|
|
|
|
printf(" 1. Add\n"); |
|
|
|
|
|
printf(" 2. Subtract\n"); |
|
|
|
|
|
printf(" 3. Multiply\n"); |
|
|
|
|
|
printf(" 4. Divide\n"); |
|
|
|
|
|
printf(" 5. Factorial\n"); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if(x == 'c') |
|
|
|
|
|
{ |
|
|
|
|
|
if(check() == 1) |
|
|
|
|
|
{ |
|
|
|
|
|
printf(" %d. Add\n", operation1); |
|
|
|
|
|
printf(" %d. Subtract\n", operation2); |
|
|
|
|
|
printf(" %d. Multiply\n", operation3); |
|
|
|
|
|
printf(" %d. Divide\n", operation4); |
|
|
|
|
|
printf(" %d. Factorial\n", operation5); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|