Skip to content

Commit c01c50c

Browse files
authored
Add files via upload
1 parent abe8c86 commit c01c50c

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

data-and-variables-exercises.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
let spaceshuttlename = "Determination"
2+
let spaceShuttleSpeedMph = ("17500")//Declare and assign the variables below
3+
let distanceToMarsKm = ("225000000")
4+
let distanceToMoon = ("384400")
5+
const milesPerKm = ("0.621")
6+
let milesToMars = (distanceToMarsKm * milesPerKm)
7+
let hoursToMars = (distanceToMarsKm * milesPerKm / spaceShuttleSpeedMph)
8+
let daysToMars = (hoursToMars / 24)
9+
10+
let milesToMoon = distanceToMoon * milesPerKm
11+
let hoursToMoon = distanceToMoon * milesPerKm / spaceShuttleSpeedMph
12+
let daysToMoon = hoursToMoon / 24
13+
14+
15+
16+
console.log(milesToMars)
17+
console.log(hoursToMars)
18+
console.log(daysToMars)
19+
console.log(spaceshuttlename, 'will take' ,+ (daysToMars), 'days to reach Mars!!!')
20+
console.log(milesToMoon)
21+
console.log(hoursToMoon)
22+
console.log(daysToMoon)
23+
console.log(spaceshuttlename, 'will take' ,+ (daysToMoon), 'days to reach the moon!!!')
24+
25+
26+
27+
// Use console.log to print the 'typeof' each variable. Print one item per line.
28+
29+
// Calculate a space mission below
30+
31+
// Print the results of the space mission calculations below
32+
33+
// Calculate a trip to the moon below
34+
35+
// Print the results of the trip to the moon below

0 commit comments

Comments
 (0)