From 9290e3502cf1fcb5260d12c669eec72b3bbe79a9 Mon Sep 17 00:00:00 2001 From: Isah Jacob Date: Mon, 31 Oct 2022 17:25:11 +0100 Subject: [PATCH] created two function that takes a parameter use the conversion formula to convert from fahrenheit to celsius and from celsius to fahrenheit --- 07_tempConversion/tempConversion.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/07_tempConversion/tempConversion.js b/07_tempConversion/tempConversion.js index 6ef3e85..d0e0a71 100644 --- a/07_tempConversion/tempConversion.js +++ b/07_tempConversion/tempConversion.js @@ -1,11 +1,13 @@ -const ftoc = function() { +const ftoc = function(f) { + return Math.round((f - 32) * (5/9)) +} +const ctof = function(c) { + return Math.round(((c * 9/5) + 32)) +} -}; - -const ctof = function() { - -}; +ftoc(32) +ctof(0) // Do not edit below this line module.exports = { ftoc,