|
@ -0,0 +1,51 @@ |
|
|
|
|
|
#include <stdio.h> |
|
|
|
|
|
#include <string.h> |
|
|
|
|
|
#include <stdlib.h> |
|
|
|
|
|
#include <math.h> |
|
|
|
|
|
#include <stdbool.h> |
|
|
|
|
|
|
|
|
|
|
|
#include "taschenrechner.h" |
|
|
|
|
|
// Unit converter mode |
|
|
|
|
|
|
|
|
|
|
|
void unitConverterMode() { |
|
|
|
|
|
int choice; |
|
|
|
|
|
double value, result; |
|
|
|
|
|
|
|
|
|
|
|
printf("Unit Converter Mode:\n"); |
|
|
|
|
|
|
|
|
|
|
|
printf("Distance conversions:\n"); |
|
|
|
|
|
printf("1. Convert Meter (cm, m, km)\n"); |
|
|
|
|
|
printf("2. Meter to foot/inches\n"); |
|
|
|
|
|
printf("3. Kilometer to Miles\n"); |
|
|
|
|
|
|
|
|
|
|
|
printf("Weight conversion:\n"); |
|
|
|
|
|
printf("4. Convert Gram (mg, g, kg)\n"); |
|
|
|
|
|
|
|
|
|
|
|
printf("Temprature conversion:\n"); |
|
|
|
|
|
printf("5. Celsius to Fahrenheit\n"); |
|
|
|
|
|
|
|
|
|
|
|
printf("Speed conversion:\n"); |
|
|
|
|
|
printf("6. km/h to mph \n"); |
|
|
|
|
|
|
|
|
|
|
|
printf("Fluid conversion:\n"); |
|
|
|
|
|
printf("7. Convert Liter (ml, l, kl) \n"); |
|
|
|
|
|
printf("8. Liter to Gallon\n"); |
|
|
|
|
|
|
|
|
|
|
|
printf("Data conversions:\n"); |
|
|
|
|
|
printf("9. Convert Data size (MB, GB, TB)\n"); |
|
|
|
|
|
|
|
|
|
|
|
printf("Area/Volume conversions \n"); |
|
|
|
|
|
printf("10. Convert area (cm², m², km²) \n"); |
|
|
|
|
|
printf("11. Convert Volume (cm³, m³, km³)\n"); |
|
|
|
|
|
|
|
|
|
|
|
printf("Time conversion \n"); |
|
|
|
|
|
printf("13. Convert time (s, m, h) \n"); |
|
|
|
|
|
printf("14. Convert Clock (12 Hour, 24 Hour) \n"); |
|
|
|
|
|
|
|
|
|
|
|
printf("\nEnter your choice (Exit with 0): "); |
|
|
|
|
|
scanf("%d", &choice); |
|
|
|
|
|
|
|
|
|
|
|
printf("Enter the value to convert: "); |
|
|
|
|
|
scanf("%lf", &value); |
|
|
|
|
|
|
|
|
|
|
|
} |