Skip to content

Commit cf4d96f

Browse files
committed
shuttle launch studio finished
1 parent 1396c0f commit cf4d96f

File tree

1 file changed

+68
-0
lines changed

1 file changed

+68
-0
lines changed
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,83 @@
11
// Initialize Variables below
2+
const date = "Monday 2019-03-18"
3+
const time = "10:05:34 AM"
4+
const astronautCount = 7
5+
const astronautStatus = "ready"
6+
const averageAstronautMassKg = 80.7
7+
const crewMassKg = (astronautCount * averageAstronautMassKg)
8+
const fuelMassKg = 760000
9+
const shuttleMassKg = 74842.31
10+
const totalMassKg = (crewMassKg + fuelMassKg + shuttleMassKg)
11+
const maximumMassKg = 850000
12+
const fuelTempCelsius = -225
13+
const minimumFuelTemp = -300
14+
const maximumFuelTemp = -150
15+
const fuelLevel = "100%"
16+
const weatherStatus = "clear"
17+
let preparedForLiftoff = true
218

319
// add logic below to verify total number of astronauts for shuttle launch does not exceed 7
20+
if (astronautCount <= 7) {
21+
console.log("Astronaut count: ", astronautCount)
22+
} else {
23+
console.log("Astronaut count:", astronautCount)
24+
preparedForLiftoff = false
25+
}
426

527
// add logic below to verify all astronauts are ready
28+
if (astronautStatus === "ready") {
29+
console.log("Astronaut status: ", astronautStatus)
30+
} else {
31+
console.log("Astronaut status: ", astronautStatus)
32+
preparedForLiftoff = false
33+
}
634

735
// add logic below to verify the total mass does not exceed the maximum limit of 850000
36+
if (totalMassKg < maximumMassKg) {
37+
console.log("Total Mass: ", totalMassKg)
38+
} else {
39+
console.log("Total mass: ",totalMassKg)
40+
preparedForLiftoff = false
41+
}
842

943
// add logic below to verify the fuel temperature is within the appropriate range of -150 and -300
44+
if (fuelTempCelsius >= -300 && fuelTempCelsius <= -150) {
45+
console.log("Fuel Temperature: ", fuelTempCelsius);
46+
} else {
47+
console.log("Fuel temperature: ",fuelTempCelsius)
48+
preparedForLiftoff = false
49+
}
1050

1151
// add logic below to verify the fuel level is at 100%
52+
if (fuelLevel === "100%") {
53+
console.log("Fuel Level: ",fuelLevel)
54+
} else {
55+
console.log("Fuel level: ",fuelLevel)
56+
preparedForLiftoff = false
57+
}
58+
1259

1360
// add logic below to verify the weather status is clear
61+
if (weatherStatus === "clear") {
62+
console.log("Weather status: ",weatherStatus)
63+
} else {
64+
console.log("Weather status: ",weatherStatus)
65+
preparedForLiftoff = false
66+
}
1467

1568
// Verify shuttle launch can proceed based on above conditions
69+
if (preparedForLiftoff === true) {
70+
console.log("All systems are a go! Initiating space shuttle launch sequence");
71+
console.log("Date: ", date);
72+
console.log("Time: ", time);
73+
console.log("Astronaut count: ",astronautCount);
74+
console.log("Crew Mass: ", crewMassKg ,"kg");
75+
console.log("Fuel Mass: ", fuelMassKg ,"kg");
76+
console.log("Shuttle Mass: ", shuttleMassKg , "kg");
77+
console.log("Total Mass: ", totalMassKg , "kg");
78+
console.log("Fuel Temperature: ", fuelTempCelsius ,"C");
79+
console.log("Weather Status: ", weatherStatus);
80+
console.log("Have a safe trip astronauts!");
81+
} else {
82+
console.log("Mission Aborted")
83+
}

0 commit comments

Comments
 (0)