From eca61652e3b36540e1eb2f99f3ffac02d28eaf62 Mon Sep 17 00:00:00 2001 From: Enrico Schellenberger Date: Tue, 6 Feb 2024 12:38:38 +0100 Subject: [PATCH] fixed error with ConvertMode.c using wrong char array in result --- src/main/c/ConvertMode.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/main/c/ConvertMode.c b/src/main/c/ConvertMode.c index 5a79e46..61db393 100644 --- a/src/main/c/ConvertMode.c +++ b/src/main/c/ConvertMode.c @@ -89,7 +89,7 @@ double getValue(int choice) { result = ConGram(value, startingUnit, endingUnit); - printf("\nThe convertet result is %dlf %d", result, Distance[endingUnit]); + printf("\nThe convertet result is %dlf %d", result, Weight[endingUnit]); break; case 5://'kg', 'pounds' @@ -101,7 +101,7 @@ double getValue(int choice) { result = ConGramToPounds(value, startingUnit, endingUnit); - printf("\nThe convertet result is %dlf %d", result, Distance[endingUnit]); + printf("\nThe convertet result is %dlf %d", result, Weight[endingUnit]); break; case 6://'celsius', 'fahrenheit' @@ -113,10 +113,10 @@ double getValue(int choice) { result = ConTemp(value, startingUnit, endingUnit); - printf("\nThe convertet result is %dlf %d", result, Distance[endingUnit]); + printf("\nThe convertet result is %dlf %d", result, Temp[endingUnit]); break; - case 6://'km/h','mp/h' + case 7://'km/h','mp/h' printf("\nEnter what the Unit is starting with (0 km/h, 1 mp/h): "); scanf("%d", &startingUnit); @@ -125,17 +125,13 @@ double getValue(int choice) { result = ConSpeed(value, startingUnit, endingUnit); - printf("\nThe convertet result is %dlf %d", result, Distance[endingUnit]); + printf("\nThe convertet result is %dlf %d", result, Speed[endingUnit]); break; } } } - - - - double ConLiter() { }