|
|
@ -12,7 +12,7 @@ double value, result; |
|
|
|
|
|
|
|
char Distance[] = { 'mm', 'cm', 'm', 'km', 'feet/inch', 'miles'}; |
|
|
|
char Weight[] = { 'mg', 'g', 'kg', 't', 'pounds'}; |
|
|
|
char Fluid[] = { 'ml', 'l' }; |
|
|
|
char Fluid[] = { 'ml', 'l' , 'gallon'}; |
|
|
|
char Temp[] = { 'celsius', 'fahrenheit' }; |
|
|
|
char Speed[] = { 'km/h','mp/h' }; |
|
|
|
char Data[] = { 'B', 'KB', 'MB', 'GB', 'TB', 'PT' }; |
|
|
@ -128,14 +128,62 @@ double getValue(int choice) { |
|
|
|
printf("\nThe convertet result is %dlf %d", result, Speed[endingUnit]); |
|
|
|
break; |
|
|
|
|
|
|
|
case 8://'ml', 'l' |
|
|
|
printf("\nEnter what the Unit is starting with (0 ml, 1 l): "); |
|
|
|
scanf("%d", &startingUnit); |
|
|
|
|
|
|
|
printf("\nEnter what the value should it be changed to (0 ml, 1 l): "); |
|
|
|
scanf("%d", &endingUnit); |
|
|
|
|
|
|
|
result = ConLiter(value, startingUnit, endingUnit); |
|
|
|
|
|
|
|
printf("\nThe convertet result is %dlf %d", result, Fluid[endingUnit]); |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
/* |
|
|
|
double ConSpeed(double speed, int startingUnit, int endingUnit) { |
|
|
|
switch (startingUnit) |
|
|
|
{ |
|
|
|
case 0: //kmh to x |
|
|
|
switch (endingUnit) |
|
|
|
{ |
|
|
|
case 0: //kmh to kmh |
|
|
|
return speed; |
|
|
|
break; |
|
|
|
|
|
|
|
double ConLiter() { |
|
|
|
case 1: //kmh to mph |
|
|
|
return speed * 0.621371; |
|
|
|
break; |
|
|
|
|
|
|
|
default: |
|
|
|
break; |
|
|
|
} |
|
|
|
|
|
|
|
case 1: //mph to x |
|
|
|
switch (endingUnit) |
|
|
|
{ |
|
|
|
case 0: //mph to kmh |
|
|
|
return speed * 1.60934; |
|
|
|
break; |
|
|
|
|
|
|
|
case 1: //mph to mph |
|
|
|
return speed; |
|
|
|
break; |
|
|
|
|
|
|
|
default: |
|
|
|
break; |
|
|
|
} |
|
|
|
|
|
|
|
default: |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
double ConLiterToGallon() { |
|
|
|
|
|
|
|
} |
|
|
|