File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed
data-and-variables/exercises Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change 11// Declare and assign the variables below
2+ let shuttleName = 'Determination' ;
3+ let shuttleSpeedMph = 17500 ;
4+ let distanceToMarsKm = 225000000 ;
5+ let distanceToMoonKm = 38400 ;
6+ const milesPerKm = 0.621 ;
27
38// Use console.log to print the 'typeof' each variable. Print one item per line.
9+ console . log ( typeof shuttleName ) ;
10+ console . log ( typeof shuttleSpeedMph ) ;
11+ console . log ( typeof distanceToMarsKm ) ;
12+ console . log ( typeof distanceToMoonKm ) ;
13+ console . log ( typeof milesPerKm ) ;
414
515// Calculate a space mission below
16+ let milesToMars = distanceToMarsKm * milesPerKm ;
17+ let hoursToMars = milesToMars / shuttleSpeedMph ;
18+ let daysToMars = hoursToMars / 24 ;
619
720// Print the results of the space mission calculations below
21+ console . log ( shuttleName + " will take " + daysToMars + " days to reach Mars." ) ;
822
923// Calculate a trip to the moon below
24+ let milesToMoon = distanceToMoonKm * milesPerKm ;
25+ let hoursToMoon = milesToMoon / shuttleSpeedMph ;
26+ let daysToMoon = hoursToMoon / 24 ;
1027
11- // Print the results of the trip to the moon below
28+ // Print the results of the trip to the moon below
29+ console . log ( shuttleName + " will take " + daysToMoon + " days to reach the Moon." ) ;
You can’t perform that action at this time.
0 commit comments