1
- // Initialize Variables below
1
+ let date = "Monday 2019-03-18" ;
2
+ let time = '10:05:34 AM' ;
3
+ let astronautCount = 7 ;
4
+ let astronautStatus = 'ready' ;
5
+ let averageAstronautMassKg = 80.7 ;
6
+ let crewMassKg = astronautCount * averageAstronautMassKg ;
7
+ let fuelMassKg = 760000 ;
8
+ let shuttleMassKg = 74842.31 ;
9
+ let totalMassKg = crewMassKg + fuelMassKg + shuttleMassKg ;
10
+ let maximumMassLimit = 850000 ;
11
+ let fuelTempCelsius = - 225 ;
12
+ let minimumFuelTemp = - 300 ;
13
+ let maximumFuelTemp = - 150 ;
14
+ let feulLevel = '100%' ;
15
+ let weatherStatus = 'clear' ;
16
+ let preparedForLiftOff = true ;
2
17
3
- // add logic below to verify total number of astronauts for shuttle launch does not exceed 7
4
-
5
- // add logic below to verify all astronauts are ready
6
-
7
- // add logic below to verify the total mass does not exceed the maximum limit of 850000
8
-
9
- // add logic below to verify the fuel temperature is within the appropriate range of -150 and -300
10
-
11
- // add logic below to verify the fuel level is at 100%
12
-
13
- // add logic below to verify the weather status is clear
14
-
15
- // Verify shuttle launch can proceed based on above conditions
18
+ if ( astronautCount > ! 7 ) ;
19
+ if ( astronautStatus === 'ready' ) ;
20
+ if ( totalMassKg < maximumMassLimit ) ;
21
+ if ( fuelTempCelsius < ! minimumFuelTemp || fuelTempCelsius > ! maximumFuelTemp ) ;
22
+ if ( feulLevel === '100%' ) ;
23
+ if ( weatherStatus = 'clear' ) ;
24
+ if ( ( astronautCount > ! 7 ) && ( astronautStatus = "ready" ) && ( totalMassKg <= maximumMassLimit ) && ( fuelTempCelsius < ! minimumFuelTemp || fuelTempCelsius > ! maximumFuelTemp ) && ( fuelLevel = "100%" ) && ( weatherStatus = "clear" ) ) {
25
+ preparedForLiftOff = true
26
+ console . log ( "All systems are a go! Initiating space shuttle launch sequence." )
27
+ console . log ( "----------------------------------------" )
28
+ console . log ( "Date:" , date ) ;
29
+ console . log ( "Time:" , time ) ;
30
+ console . log ( "Astronaut Count:" , astronautCount ) ;
31
+ console . log ( "Crew Mass:" , crewMassKg ) ;
32
+ console . log ( "Fuel Mass:" , fuelMassKg ) ;
33
+ console . log ( "Shuttle Mass:" , shuttleMassKg ) ;
34
+ console . log ( "Total Mass:" , totalMassKg ) ;
35
+ console . log ( "Fuel Temperature:" , fuelTempCelsius ) ;
36
+ console . log ( "Weather Status:" , weatherStatus ) ;
37
+ console . log ( "----------------------------------------" )
38
+ console . log ( 'See you Space Cowboys' )
39
+ }
40
+ else {
41
+ preparedForLiftOff = false
42
+ console . log ( "harry we have a houdini" )
43
+ }
0 commit comments