Skip to content

Commit 203c578

Browse files
committed
Space Launch Studio
1 parent a0ba33f commit 203c578

File tree

1 file changed

+60
-6
lines changed

1 file changed

+60
-6
lines changed
Lines changed: 60 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,69 @@
11
// Initialize Variables below
2+
let date = "Monday 2019-03-18"
3+
let time = "10:05:34 AM"
4+
let astronautCount = 7
5+
let astronautStatus = "ready"
6+
let averageAstronautMassKg = 80.7
7+
let crewMassKg = astronautCount * averageAstronautMassKg
8+
let fuelMassKg = 760000
9+
let shuttleMassKg = 74842.31
10+
let totalMassKg = crewMassKg + fuelMassKg + shuttleMassKg
11+
let maximumMassLimit = 850000
12+
let fuelTemplCelsius = -225
13+
let minimumFuelTemp = -300
14+
let maximumFuelTemp = -150
15+
let fuelLevel = "100%"
16+
let weatherStatus = "clear"
17+
let preparedForLiftOff = false
18+
let divider = "------------------------------------------"
219

20+
console.log("Assessing pre-liftoff requirements...\n", divider +"\n", date +"\n",time)
321
// add logic below to verify total number of astronauts for shuttle launch does not exceed 7
4-
22+
if (astronautCount > 7) {
23+
console.log("Too many astronauts!");
24+
preparedForLiftOff = false;
25+
} else {
26+
console.log("There are a normal amount of astronauts.");
27+
}
528
// add logic below to verify all astronauts are ready
6-
29+
if (astronautStatus != "ready") {
30+
console.log("The astronauts refused!");
31+
preparedForLiftOff = false;
32+
} else {
33+
console.log("The astronauts are good to go.")
34+
}
735
// add logic below to verify the total mass does not exceed the maximum limit of 850000
8-
36+
if (totalMassKg > maximumMassLimit) {
37+
console.log("Total mass EXCEEDED")
38+
preparedForLiftOff = false;
39+
} else {
40+
console.log("Total mass NOT exceeded")
41+
}
942
// add logic below to verify the fuel temperature is within the appropriate range of -150 and -300
10-
43+
if (fuelTemplCelsius < -300 || fuelTemplCelsius > -150) {
44+
console.log("Fuel temperature irregular.")
45+
preparedForLiftOff = false;
46+
} else {
47+
console.log("Fuel temperature normal!")
48+
}
1149
// add logic below to verify the fuel level is at 100%
12-
50+
if (fuelLevel === "100%") {
51+
console.log("Fuel level 100%.")
52+
} else {
53+
console.log("Fueling required!")
54+
preparedForLiftOff = false;
55+
}
1356
// add logic below to verify the weather status is clear
14-
57+
if (weatherStatus === "clear") {
58+
console.log("Weather is clear.")
59+
} else {
60+
console.log("Weather does not meet standard.")
61+
preparedForLiftOff = false;
62+
}
63+
console.log(divider)
1564
// Verify shuttle launch can proceed based on above conditions
65+
if (preparedForLiftOff == false) {
66+
console.log("Cannot liftoff at this time. Hold out astronauts!")
67+
} else {
68+
console.log("Prepare for liftoff. Have fun astronauts!")
69+
}

0 commit comments

Comments
 (0)