|
@ -1,6 +1,9 @@ |
|
|
#include "calculatorGetUserInput.h" |
|
|
#include "calculatorGetUserInput.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 allowOnly() |
|
|
|
|
|
|
|
|
int allowOnly() //int allowOnly() is helpful for indirectly testing void calculatorGetUserInput(). |
|
|
{ |
|
|
{ |
|
|
if(a == 1) |
|
|
if(a == 1) |
|
|
{ |
|
|
{ |
|
@ -8,13 +11,15 @@ int allowOnly() |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void calculatorGetUserInput(float *x, float *y) |
|
|
|
|
|
|
|
|
void calculatorGetUserInput(float *num1, float *num2) |
|
|
{ |
|
|
{ |
|
|
if (allowOnly() == 1) |
|
|
|
|
|
|
|
|
if (allowOnly() == 1) //only if int allowOnly() returns 1, void calculatorGetUserInput will display the desired output. |
|
|
{ |
|
|
{ |
|
|
printf("number1: "); |
|
|
printf("number1: "); |
|
|
scanf("%f", x); |
|
|
|
|
|
|
|
|
scanf("%f", num1); |
|
|
printf("number2: "); |
|
|
printf("number2: "); |
|
|
scanf("%f", y); |
|
|
|
|
|
|
|
|
scanf("%f", num2); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|