123456789101112131415161718192021222324 |
- let shuttleName ='Determination';
- let shuttleSpeed = 17500;
- const DISTANCE_TO_MARS_KM = 225000000;
- const DISTANCE_TO_THE_MOON_KM = 384400;
- const MILES_PER_KM = 0.621;
- const HOURS_PER_DAY = 24;
-
- console.log(typeof shuttleName);
- console.log(typeof shuttleSpeed);
- console.log(typeof DISTANCE_TO_MARS_KM);
- console.log(typeof DISTANCE_TO_THE_MOON_KM);
- console.log(typeof MILES_PER_KM);
-
- let milesToMars = DISTANCE_TO_MARS_KM * MILES_PER_KM;
- let hoursToMars = milesToMars / shuttleSpeed;
- let daysToMars = hoursToMars / HOURS_PER_DAY;
-
- console.log(shuttleName + ' will take ' + daysToMars.toFixed(2) + ' days to reach Mars')
-
- let milesToMoon = DISTANCE_TO_THE_MOON_KM * MILES_PER_KM;
- let hoursToMoon = milesToMoon / shuttleSpeed;
- let daysToMoon = hoursToMoon / HOURS_PER_DAY;
-
- console.log(shuttleName + ' will take ' + daysToMoon.toFixed(2) + ' days to reach Moon')
|