123456789101112131415161718192021222324252627282930 |
- 'use strict'
-
- let nameSS = "Determination";
- let shuttleSpeedMph = 17_500;
- 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 (nameSS));
- 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 milesMars = (DISTANCE_TO_MARS_KM * MILES_PER_KM);
- let hoursMars = (milesMars / shuttleSpeedMph);
- let daysMars = (hoursMars / HOURS_PER_DAY);
-
- console.log(milesMars, 'miles to Mars');
- console.log(hoursMars, 'hours to Mars');
- console.log(nameSS, 'will take', daysMars, 'days to reach Mars');
-
- let milesMoon = (DISTANCE_TO_MOON_KM * MILES_PER_KM);
- let hoursMoon = (milesMoon / shuttleSpeedMph);
- let daysMoon = (hoursMoon / HOURS_PER_DAY);
-
- console.log(milesMoon, 'Miles to the Moon');
- console.log(hoursMoon, 'hours to Mars');
- console.log(nameSS, 'will take', daysMoon, 'days to reach the Moon');
|