1
1
// Declare and assign the variables below
2
+ spaceShuttleName = "Determination" ;
3
+ shuttleSpeedMPH = 17500 ;
4
+ distanceToMarsKM = 225000000 ;
5
+ distanceToMoonKM = 384400 ;
6
+ milesPerKilometer = 0.621 ;
2
7
3
8
// Use console.log to print the 'typeof' each variable. Print one item per line.
9
+ console . log ( typeof spaceShuttleName ) ;
10
+ console . log ( typeof shuttleSpeedMPH ) ;
11
+ console . log ( typeof distanceToMarsKM ) ;
12
+ console . log ( typeof distanceToMoonKM ) ;
13
+ console . log ( typeof milesPerKilometer ) ;
4
14
5
15
// Calculate a space mission below
6
-
16
+ milesToMars = distanceToMarsKM * milesPerKilometer ;
17
+ //console.log(milesToMars);
18
+ hoursToMars = milesToMars / shuttleSpeedMPH ;
19
+ //console.log(hoursToMars);
20
+ daysToMars = hoursToMars / 24 ;
21
+ //console.log(daysToMars);
7
22
// Print the results of the space mission calculations below
23
+ console . log ( `${ spaceShuttleName } will take ${ daysToMars } days to reach Mars.` ) ;
8
24
9
25
// Calculate a trip to the moon below
26
+ milesToMoon = distanceToMoonKM * milesPerKilometer ;
27
+ hoursToMoon = milesToMoon / shuttleSpeedMPH ;
28
+ daysToMoon = hoursToMoon / 24 ;
29
+ //console.log(milesToMoon);
30
+ //console.log(hoursToMoon);
31
+ //console.log(daysToMoon);
10
32
11
- // Print the results of the trip to the moon below
33
+ // Print the results of the trip to the moon below
34
+ console . log ( `${ spaceShuttleName } will take ${ daysToMoon } days to reach the Moon.` ) ;
0 commit comments