File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed
data-and-variables/exercises Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change 8
8
9
9
// Calculate a trip to the moon below
10
10
11
- // Print the results of the trip to the moon below
11
+ // Print the results of the trip to the moon below
12
+
13
+ let shuttleName = 'Determination' ;
14
+ let shuttleSpeedMph = 17500 ;
15
+ let distanceToMarsKm = 225000000 ;
16
+ let distanceToMoonKm = 38400 ;
17
+ const milesPerKm = 0.621 ;
18
+
19
+ /*console.log(typeof(shuttleName));
20
+ console.log(typeof(shuttleSpeedMph));
21
+ console.log(typeof(distanceToMarsKm));
22
+ console.log(typeof(distanceToMoonKm));
23
+ console.log(typeof(milesPerKm));*/
24
+
25
+ /*let milesToMars = distanceToMarsKm * milesPerKm;
26
+ let hoursToMars = milesToMars / shuttleSpeedMph;
27
+ let daysToMars = hoursToMars / 24;*/
28
+
29
+ let milesToMoon = distanceToMoonKm * milesPerKm ;
30
+ let hoursToMoon = milesToMoon / shuttleSpeedMph ;
31
+ let daysToMoon = hoursToMoon / 24 ;
32
+
33
+ console . log ( shuttleName + " will take " + daysToMoon + " days to reach the Moon." ) ;
You can’t perform that action at this time.
0 commit comments