diff --git a/src/main/c/ConvertMode.c b/src/main/c/ConvertMode.c new file mode 100644 index 0000000..ef9e7be --- /dev/null +++ b/src/main/c/ConvertMode.c @@ -0,0 +1,51 @@ +#include +#include +#include +#include +#include + +#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); + +} \ No newline at end of file diff --git a/src/main/c/main_taschenrechner.c b/src/main/c/main_taschenrechner.c index 02c981a..edbc325 100644 --- a/src/main/c/main_taschenrechner.c +++ b/src/main/c/main_taschenrechner.c @@ -166,23 +166,7 @@ void programmingMode() { } -// Unit converter mode -void unitConverterMode() { - int choice; - double value, result; - - printf("Unit Converter Mode:\n"); - printf("1. Meter to Kilometer\n"); - printf("2. Kilogram to Gram\n"); - printf("3. Celsius to Fahrenheit\n"); - printf("Enter your choice: "); - scanf("%d", &choice); - - printf("Enter the value to convert: "); - scanf("%lf", &value); - -} // change mode int mode(int userChoice){