From 6901b44e9cef9110ac9402eb8db2e7fe109d7385 Mon Sep 17 00:00:00 2001 From: Emily Kanarek Date: Mon, 5 May 2025 12:19:06 -0400 Subject: [PATCH] Complete conditional statement functions --- index.js | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/index.js b/index.js index 8f86e134cb..978765fa8a 100644 --- a/index.js +++ b/index.js @@ -1,11 +1,26 @@ -function scuberGreetingForFeet(){ - // Write your code here! +function scuberGreetingForFeet(n){ + if (n <= 400) { + return "This one is on me!"; + } else if (n >= 400 && n <= 2000) { + return "That will be twenty bucks."; + } else if (n > 2000 && n < 2500) { + return "I will gladly take your thirty bucks."; + } else { + return "No can do."; + } } -function ternaryCheckCity(){ - // Write your code here! +function ternaryCheckCity(city){ + return city === "NYC" ? "Ok, sounds good." : "No go."; } -function switchOnCharmFromTip(){ - // Write your code here! +function switchOnCharmFromTip(tip){ + switch(tip){ + case 'generous': + return "Thank you so much." + case 'not as generous': + return "Thank you." + default: + return "Bye." + } } \ No newline at end of file