12345678910111213141516171819202122232425 |
- let shuttleName = 'Determination';
- let shuttleSpeedMph = 17_000;
- const DISTANCE_TO_MARS_KM = 225_000_000;
- const DISTANCE_TO_MOON_KM = 384_400;
- const MILES_PER_KM = 0.621;
- const HOURS_PER_DAY = 24;
-
- console.log(typeof shuttleName);
- console.log(typeof shuttleSpeedMph);
- console.log(typeof DISTANCE_TO_MARS_KM);
- console.log(typeof DISTANCE_TO_MOON_KM);
- console.log(typeof MILES_PER_KM);
-
- let milesToMars = DISTANCE_TO_MARS_KM * MILES_PER_KM;
- let hoursToMars = milesToMars / shuttleSpeedMph;
- let daysToMars = hoursToMars / HOURS_PER_DAY;
-
- console.log(shuttleName + ' will take ' + daysToMars + ' days to reach Mars.');
-
- let milesToMoon = DISTANCE_TO_MOON_KM * MILES_PER_KM;
- let hoursToMoon = milesToMoon / shuttleSpeedMph;
- let daysToMoon = hoursToMoon / HOURS_PER_DAY;
-
- console.log(shuttleName + ' will take ' + daysToMoon + ' days to reach Moon.');
|