From 971fdc8ed687ea0b299f283bb54d8a7b37032f0b Mon Sep 17 00:00:00 2001 From: Seemeebee Date: Fri, 29 May 2026 12:04:27 -0500 Subject: [PATCH] Implement --- .../functions-intro/exercises/practice.js | 26 ++++++++++++++++--- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/tutorials/07-functions/functions-intro/exercises/practice.js b/tutorials/07-functions/functions-intro/exercises/practice.js index fa0b458..cda7c7f 100644 --- a/tutorials/07-functions/functions-intro/exercises/practice.js +++ b/tutorials/07-functions/functions-intro/exercises/practice.js @@ -7,15 +7,23 @@ /** EXERCISE 1: THE WELCOME PROTOCOL **/ +function greetCrew() { + console.log("Welcome back, Captain."); +} + +greetCrew(); + /* - TODO: Declare a function named 'greetCrew'. Inside the function, - log "Welcome back, Captain." to the console. + TODO: Declare a function named 'greetCrew'. Inside the function, log "Welcome back, Captain." to the console. Then, invoke the function once below its declaration. -*/ /** EXERCISE 2: LIFE SUPPORT BOOST **/ -/* +function activeOxygenBoost() { + console.log("Pumping extra oxygen into sectors A-D... Done."); +} + +/* TODO: Declare a function named 'activateOxygenBoost'. Inside, log "Pumping extra oxygen into sectors A-D... Done." Do not call it yet. @@ -25,6 +33,14 @@ let crewIsSleepy = true; +function activateOxygenBoost() { + console.log("Pumping extra oxygen into sectors A-D... Done."); +} + +if (crewIsSleepy === true) { + activateOxygenBoost(); +} + /* TODO: Create an 'if' statement that checks if 'crewIsSleepy' is true. If it is, invoke the 'activateOxygenBoost' function @@ -40,6 +56,8 @@ function startEngines() { function clearLaunchPad() { console.log("Launch pad: CLEARED."); } +clearLaunchPad(); +startEngines(); /* TODO: Call 'clearLaunchPad' first, and then call 'startEngines'