Skip to content

Commit 0c26116

Browse files
committed
added c
1 parent 857df83 commit 0c26116

File tree

1 file changed

+70
-12
lines changed

1 file changed

+70
-12
lines changed

booleans-and-conditionals/studio/data-variables-conditionals.js

Lines changed: 70 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,24 +31,82 @@ let fuelLevel = "100%" ;
3131
let weatherStatus = "clear" ;
3232
let preparedForLiftOff = true ;
3333

34-
if (astronautCount <= 7) {
35-
console.log("All crew Counted.");
34+
35+
if (astronautCount < 7) {
36+
37+
}
38+
else {
39+
let preparedForLiftOff =false ;
3640
}
3741
if (astronautStatus === "ready") {
38-
console.log ("All crew Prepared.") ;
42+
43+
}
44+
else {
45+
preparedForLiftOff =false ;
3946
}
4047
if (totalMassKg < 85000) {
41-
console.log ("Weight level stable.") ;
48+
4249
}
43-
if (fuelTempCelsius > -300 && fuelTempCelsius < -150) {
44-
console.log("fuel temperature safe.") ;
50+
else {
51+
preparedForLiftOff =false ;
52+
}
53+
if (fuelTempCelsius > -300 && fuelTempCelsius <-150) {
54+
4555
}
46-
if (fuelLevel === "100%") {
47-
console.log("Temperature safe.") ;
56+
else {
57+
preparedForLiftOff =false ;
58+
}
59+
if (fuelLevel === "100%") {
60+
4861
}
49-
if (weatherStatus === "clear") {
50-
console.log ("shuttle ready for launch!")
62+
else {
63+
preparedForLiftOff =false ;
64+
}
65+
66+
if (weatherStatus === "clear") {
67+
5168
}
52-
else console.log ("Error in launch! Check Weight, Fuel, and Weather.") ;
69+
else {
70+
preparedForLiftOff =false ;
71+
}
72+
if (preparedForLiftOff = true) {
73+
console.log ("-------------------------------------------");
74+
console.log ("Date:" + date);
75+
console.log ("Time:" + time);
76+
console.log ("Astronaut Count:" + astronautCount);
77+
console.log ("Crew Mass:" + crewMassKg);
78+
console.log ("Fuel Mass:" + fuelMassKg + "kg");
79+
console.log ("Total Mass:" +totalMassKg + "kg");
80+
console.log ("Fuel Temperature:" + fuelTempCelsius + "C");
81+
console.log ("Weather Status:" + weatherStatus );
82+
console.log ("-------------------------------------------")
83+
}
84+
else {
85+
console.log("Error Launch aborted.")
86+
}
87+
88+
89+
//
90+
// if (astronautCount <= 7) {
91+
// console.log("All crew Counted.");
92+
// }
93+
// if (astronautStatus === "ready") {
94+
// console.log ("All crew Prepared.") ;
95+
// }
96+
// if (totalMassKg < 85000) {
97+
// console.log ("Weight level stable.") ;
98+
// }
99+
// if (fuelTempCelsius > -300 && fuelTempCelsius < -150) {
100+
// console.log("fuel temperature safe.") ;
101+
// }
102+
// if (fuelLevel === "100%") {
103+
// console.log("Temperature safe.") ;
104+
// }
105+
// if (weatherStatus === "clear") {
106+
// console.log ("shuttle ready for launch!")
107+
// }
108+
// else console.log ("Error in launch! Check Weight, Fuel, and Weather.") ;
53109

54-
110+
// if (astronautCount >= 7) {
111+
// console.log ("Error: crew has not been fully accounted for!")
112+
// }

0 commit comments

Comments
 (0)