From a7a34d5cf327aa66d68e3597f23181be45213e08 Mon Sep 17 00:00:00 2001 From: Allie Grab Date: Thu, 11 Jan 2024 22:00:15 -0600 Subject: [PATCH] studio 1 --- .../studio/data-variables-conditionals.js | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/booleans-and-conditionals/studio/data-variables-conditionals.js b/booleans-and-conditionals/studio/data-variables-conditionals.js index 6a15e146f4..ef1f90c26d 100644 --- a/booleans-and-conditionals/studio/data-variables-conditionals.js +++ b/booleans-and-conditionals/studio/data-variables-conditionals.js @@ -1,6 +1,54 @@ // Initialize Variables below +let date = ("Monday 2019-03-18"); +console.log(date); +let time = ("10:05:34AM"); +let astronautCount = (8); +let astronautStatus = ("ready"); +let averageAstronautMassKg = (80.7); +let crewMassKg = (astronautCount * averageAstronautMassKg); +let fuelMassKg = (760000); +let shuttleMassKg = (74842.31); +let totalMassKg = (crewMassKg + fuelMassKg + shuttleMassKg); +let maximumMassLimit = (850000); +let fuelTempCelsius = (-225); +let minimumFuelTemp = (-300); +let maximumFuelTemp = (-150); +let fuelLevel = ("100%"); +let weatherStatus = ("clear"); +let preparedForLiftOff = (true); + + // add logic below to verify total number of astronauts for shuttle launch does not exceed 7 +if (astronautCount <= 7){ + console.log("Go!")} + else {console.log("astronaut is not ready") +preparedForLiftOff = false}; + +if (astronautStatus === "ready"){ + console.log("Astronauts Ready")} + else {console.log("Wait") +preparedForLiftOff = false}; + +if (totalMassKg <= maximumMassLimit){ + console.log("OK")} + else {console.log("decrease") +preparedForLiftOff = false}; + +if (fuelTempCelsius >= -300 || fuelTempCelsius <= -150){ + console.log("fuel temp ok")} + else {console.log("not safe") +preparedForLiftOff = false}; + +if (fuelLevel === "100%"){ + console.log("full")} + else {console.log("fill up") +preparedForLiftOff = false}; + +if (weatherStatus === "clear"){ + console.log("clear day")} + else {console.log("not safe") +preparedForLiftOff = false}; // add logic below to verify all astronauts are ready @@ -13,3 +61,8 @@ // add logic below to verify the weather status is clear // Verify shuttle launch can proceed based on above conditions + + +if (preparedForLiftOff === true){ + console.log("liftoff") +} \ No newline at end of file