|
@ -7,6 +7,77 @@ |
|
|
#include "taschenrechner.h" |
|
|
#include "taschenrechner.h" |
|
|
// Unit converter mode |
|
|
// Unit converter mode |
|
|
|
|
|
|
|
|
|
|
|
double getValue() { |
|
|
|
|
|
printf("Enter the first value to convert: "); |
|
|
|
|
|
scanf("%lf", &value); |
|
|
|
|
|
|
|
|
|
|
|
printf("Enter the second value to convert: "); |
|
|
|
|
|
scanf("%lf", &value); |
|
|
|
|
|
|
|
|
|
|
|
while (choice < 0 && choice >= 14) { |
|
|
|
|
|
switch (choice) |
|
|
|
|
|
{ |
|
|
|
|
|
case 1: |
|
|
|
|
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
double ConMeter() { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
double ConMeterToFoot() { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
double ConKilometerToMiles() { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
double ConGram() { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
double ConTemp() { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
double ConSpeed() { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
double ConLiter() { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
double ConLiterToGallon() { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
double ConData() { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
double ConArea() { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
double ConVolume() { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
double ConTime() { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
double ConClock() { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void unitConverterMode() { |
|
|
void unitConverterMode() { |
|
|
int choice; |
|
|
int choice; |
|
|
double value, result; |
|
|
double value, result; |
|
@ -45,7 +116,6 @@ void unitConverterMode() { |
|
|
printf("\nEnter your choice (Exit with 0): "); |
|
|
printf("\nEnter your choice (Exit with 0): "); |
|
|
scanf("%d", &choice); |
|
|
scanf("%d", &choice); |
|
|
|
|
|
|
|
|
printf("Enter the value to convert: "); |
|
|
|
|
|
scanf("%lf", &value); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |