|
@ -127,10 +127,12 @@ void calculateMonthlyInterest(){ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void initiateCalculator() { |
|
|
void initiateCalculator() { |
|
|
|
|
|
|
|
|
int input; |
|
|
int input; |
|
|
char c; |
|
|
char c; |
|
|
printf("Welcome to the interest calculator. Please select an option:\n[1]Calculate yearly interest\n[2]Calculate monthly interest\n"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
printf("Welcome to the interest calculator. Please select an option:\n" |
|
|
|
|
|
"[1] Calculate yearly interest\n" |
|
|
|
|
|
"[2] Calculate monthly interest\n"); |
|
|
scanf("%d", &input); |
|
|
scanf("%d", &input); |
|
|
|
|
|
|
|
|
switch (input) { |
|
|
switch (input) { |
|
@ -143,15 +145,16 @@ void initiateCalculator(){ |
|
|
default: |
|
|
default: |
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
|
printf("\nThank you for using our services. Would you like to do another calculation? [y]Yes [any]No\n"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
printf("\nThank you for using our services. Would you like to do another calculation? [y/n]: "); |
|
|
scanf(" %c", &c); |
|
|
scanf(" %c", &c); |
|
|
|
|
|
|
|
|
if (c == 'y' || c == 'Y') { |
|
|
if (c == 'y' || c == 'Y') { |
|
|
initiateCalculator(); |
|
|
initiateCalculator(); |
|
|
}else{ |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// int main(){ |
|
|
// int main(){ |
|
|
|
|
|
|
|
|
// initiateCalculator(); |
|
|
// initiateCalculator(); |
|
|