123456789101112131415161718192021222324 |
- 'use strict'
- let ShuttleName = "Determination";
- let ShuttleSpeed = 17500;
- const DISTANCE_MARS = 225000000;
- const DISTANCE_MOON = 384400;
- const MILES_PER_KM = 0.621;
- const HOURS_PER_DAY = 24;
-
- console.log(typeof ShuttleName);
- console.log(typeof ShuttleSpeed);
- console.log(typeof DISTANCE_MARS);
- console.log(typeof DISTANCE_MOON);
- console.log(typeof MILES_PER_KM);
-
- let MilesToMars = DISTANCE_MARS * MILES_PER_KM;
- let HoursToMars = MilesToMars / ShuttleSpeed;
- let DaysToMars = HoursToMars / HOURS_PER_DAY;
-
- let MilesToMoon = DISTANCE_MOON * MILES_PER_KM;
- let HoursToMoon = MilesToMoon / ShuttleSpeed;
- let DaysToMoon = HoursToMoon / HOURS_PER_DAY;
-
- console.log(ShuttleName + " will take " + DaysToMars + "days to reach Mars.");
- console.log(ShuttleName + " will take " + DaysToMoon + "days to reach the Moon.");
|