Skip to content

Commit 7dc34e1

Browse files
committed
CH 5 STUDIO V1
1 parent 337d2bb commit 7dc34e1

File tree

1 file changed

+74
-0
lines changed

1 file changed

+74
-0
lines changed
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,89 @@
11
// Initialize Variables below
22

3+
let date = "Monday 2019-03-18";
4+
let time = "10:05:34 AM";
5+
let astronautCount = 7;
6+
let astronautStatus = "ready";
7+
let averageAstronautMassKg = 80.7;
8+
let crewMassKg = astronautCount * averageAstronautMassKg;
9+
let fuelMassKg = 760000;
10+
let shuttleMassKg = 74842.31;
11+
let totalMassKg = crewMassKg + fuelMassKg + shuttleMassKg;
12+
let maximumMassLimit = 850000;
13+
const fuelTempCelsius = -225;
14+
const minimumFuelTemp = -300;
15+
const fuelLevel = "100%";
16+
const weatherStatus = "clear";
17+
let preparedForLiftOff = true;
18+
let readyCheck = 0;
19+
20+
321
// add logic below to verify total number of astronauts for shuttle launch does not exceed 7
422

23+
if (astronautCount <= 7) {
24+
console.log("Crew accounted for.");
25+
//console.log("Ready Check ")
26+
readyCheck += 1;
27+
}
28+
29+
30+
531
// add logic below to verify all astronauts are ready
632

33+
if (astronautStatus === 'ready') {
34+
console.log("Crew ready.");
35+
readyCheck += 1;
36+
}
37+
738
// add logic below to verify the total mass does not exceed the maximum limit of 850000
39+
//if the totalMassKg is less than the maximumMassLimit of 850000
40+
if (totalMassKg < maximumMassLimit) {
41+
console.log("Total Mass Kg within limit.");
42+
readyCheck += 1;
43+
}
44+
845

946
// add logic below to verify the fuel temperature is within the appropriate range of -150 and -300
47+
// if the fuelTempCelsius is no less than -300 OR no greater than -150
48+
49+
if (fuelTempCelsius > -300 || fuelTempCelsius < -150) {
50+
console.log("Fuel Temp in range.");
51+
readyCheck += 1;
52+
}
1053

1154
// add logic below to verify the fuel level is at 100%
1255

56+
if (fuelLevel === "100%") {
57+
console.log("Fuel Tank is Full.");
58+
readyCheck += 1;
59+
}
60+
1361
// add logic below to verify the weather status is clear
1462

63+
if (weatherStatus === "clear") {
64+
console.log("Sky is Clear.");
65+
readyCheck += 1;
66+
}
67+
1568
// Verify shuttle launch can proceed based on above conditions
69+
if (readyCheck === 6) {
70+
console.log(`Ready Check: ${readyCheck}/6`);
71+
console.log("All systems are a go! Initiating space shuttle launch sequence.");
72+
console.log("");
73+
console.log("░I░N░I░T░I░A░L░I░Z░I░N░G░");
74+
console.log(`Date: ${date}`);
75+
console.log(`Time: ${time}`);
76+
console.log(`Astronaut Count: ${astronautCount}`);
77+
console.log(`Crew Mass: ${crewMassKg} kg`);
78+
console.log(`Fuel Mass: ${fuelMassKg} kg`);
79+
console.log(`Shuttle Mass: ${shuttleMassKg} kg`);
80+
console.log(`Total Mass: ${totalMassKg} kg`);
81+
console.log(`Fuel Temperature: ${fuelTempCelsius} °C`);
82+
console.log(`Weather Status: ${weatherStatus}`);
83+
console.log("░I░N░I░T░I░A░T░I░N░G░ ░L░A░U░N░C░H░ ░S░E░Q░U░E░N░C░E░");
84+
console.log("");
85+
console.log("(人´∀`).☆.。.:* Have a safe trip astronauts! ☆彡");
86+
} else {
87+
("Scrub launch...")
88+
}
89+

0 commit comments

Comments
 (0)