@@ -31,24 +31,82 @@ let fuelLevel = "100%" ;
31
31
let weatherStatus = "clear" ;
32
32
let preparedForLiftOff = true ;
33
33
34
- if ( astronautCount <= 7 ) {
35
- console . log ( "All crew Counted." ) ;
34
+
35
+ if ( astronautCount < 7 ) {
36
+
37
+ }
38
+ else {
39
+ let preparedForLiftOff = false ;
36
40
}
37
41
if ( astronautStatus === "ready" ) {
38
- console . log ( "All crew Prepared." ) ;
42
+
43
+ }
44
+ else {
45
+ preparedForLiftOff = false ;
39
46
}
40
47
if ( totalMassKg < 85000 ) {
41
- console . log ( "Weight level stable." ) ;
48
+
42
49
}
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
+
45
55
}
46
- if ( fuelLevel === "100%" ) {
47
- console . log ( "Temperature safe." ) ;
56
+ else {
57
+ preparedForLiftOff = false ;
58
+ }
59
+ if ( fuelLevel === "100%" ) {
60
+
48
61
}
49
- if ( weatherStatus === "clear" ) {
50
- console . log ( "shuttle ready for launch!" )
62
+ else {
63
+ preparedForLiftOff = false ;
64
+ }
65
+
66
+ if ( weatherStatus === "clear" ) {
67
+
51
68
}
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.") ;
53
109
54
-
110
+ // if (astronautCount >= 7) {
111
+ // console.log ("Error: crew has not been fully accounted for!")
112
+ // }
0 commit comments