Skip to content

Commit d5db1ef

Browse files
committed
Shuttle launch studio
1 parent 4a4596f commit d5db1ef

File tree

1 file changed

+60
-5
lines changed

1 file changed

+60
-5
lines changed
Lines changed: 60 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,70 @@
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 fuelTempCelsius = -225;
13+
let minimumFuelTemp = -300;
14+
let maximumFuelTemp = -150;
15+
let fuelLevel = 100.00;
16+
let weatherStatus = "clear";
17+
let preparedForLiftOff = true;
218

3-
// add logic below to verify total number of astronauts for shuttle launch does not exceed 7
419

20+
// add logic below to verify total number of astronauts for shuttle launch does not exceed 7
21+
if (astronautCount <= 7){
22+
preparedForLiftOff = true;
23+
} else {
24+
preparedForLiftOff = false;
25+
}
526
// add logic below to verify all astronauts are ready
627

7-
// add logic below to verify the total mass does not exceed the maximum limit of 850000
28+
if (astronautStatus = "ready"){
29+
} else {
30+
preparedForLiftOff = false;
31+
}
832

33+
// add logic below to verify the total mass does not exceed the maximum limit of 850000
34+
if (totalMassKg < maximumMassLimit) {
35+
} else {
36+
preparedForLiftOff = false;
37+
}
938
// add logic below to verify the fuel temperature is within the appropriate range of -150 and -300
10-
39+
if (fuelTempCelsius >= -300 || fuelTempCelsius <= -150){
40+
} else {
41+
preparedForLiftOff = false;++
42+
}
1143
// add logic below to verify the fuel level is at 100%
12-
44+
if (fuelLevel === 100){
45+
} else {
46+
preparedForLiftOff = false;
47+
}
1348
// add logic below to verify the weather status is clear
14-
49+
if (weatherStatus === "clear"){
50+
} else {
51+
preparedForLiftOff = false;
52+
}
1553
// Verify shuttle launch can proceed based on above conditions
54+
if (preparedForLiftOff) {
55+
console.log("All systems are a go! Initiating space shuttle launch sequence.");
56+
console.log("---------------------------------------------------------------");
57+
console.log("Date: " + date);
58+
console.log("Time: " + time);
59+
console.log("Astronaut Count: " + astronautCount);
60+
console.log("Crew Mass: " + crewMassKg);
61+
console.log("Fuel Mass: " + fuelMassKg);
62+
console.log("Shuttle Mass: " + shuttleMassKg);
63+
console.log("Total Mass: " + totalMassKg);
64+
console.log("Fuel Temperature: " + fuelTempCelsius);
65+
console.log("Weather Status: " + weatherStatus);
66+
console.log("---------------------------------------------------------------");
67+
console.log("Have a safe trip astronats!");
68+
} else {
69+
console.log("Shutdown launch sequence");
70+
}

0 commit comments

Comments
 (0)