|
@ -0,0 +1,44 @@ |
|
|
|
|
|
// scientificMode |
|
|
|
|
|
|
|
|
|
|
|
#include <stdio.h> |
|
|
|
|
|
#include <math.h> |
|
|
|
|
|
#include "taschenrechner.h" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int scientificMode(){ |
|
|
|
|
|
|
|
|
|
|
|
double num, result; |
|
|
|
|
|
|
|
|
|
|
|
int choice; |
|
|
|
|
|
|
|
|
|
|
|
printf("Enter a number: "); |
|
|
|
|
|
|
|
|
|
|
|
scanf("%lf", &num); // scan the number from user |
|
|
|
|
|
|
|
|
|
|
|
printf("Scientific mode Options:\n"); |
|
|
|
|
|
printf("1: Square root:\n"); |
|
|
|
|
|
printf("2: Exponential:\n"); |
|
|
|
|
|
printf("2: Logarithm:\n"); |
|
|
|
|
|
printf("4: Trigonomertic"); |
|
|
|
|
|
scanf("%d", &choice); // user choice |
|
|
|
|
|
|
|
|
|
|
|
switch(choice) { |
|
|
|
|
|
|
|
|
|
|
|
case 1: // Square root |
|
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
case 2: // Exponential |
|
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
case 3: // Logarithm |
|
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
case 4: // Trigonomertic |
|
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
default: printf("Invalid choice. Please try again.\n"); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return result; |
|
|
|
|
|
} |